赞
踩
FROM centos:7.9.2009
RUN yum -y update &&\
yum -y install gcc gcc-c++ &&\
yum -y install wget &&\
yum -y install bzip2.x86_64 &&\
yum -y install gcc automake autoconf libtool make &&\
mkdir -p /opt/tmp
ADD . /opt/tmp
RUN cd /opt/tmp/ &&\
tar -zxvf gcc-9.3.0.tar.gz &&\
cd /opt/tmp/gcc-9.3.0 &&\
./contrib/download_prerequisites &&\
mkdir build && cd build &&\
../configure --prefix=/usr/local/gcc-9.3.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib &&\
make &&\
make install &&\
touch /etc/profile.d/gcc.sh&&\
chmod 777 /etc/profile.d/gcc.sh &&\
echo -e '\nexport PATH=/usr/local/gcc-9.3.0/bin:$PATH\n' >> /etc/profile.d/gcc.sh && source /etc/profile.d/gcc.sh&&\
ln -sv /usr/local/gcc/include/ /usr/include/gcc&&\
touch /etc/ld.so.conf.d/gcc.conf&&\
chmod 777 /etc/ld.so.conf.d/gcc.conf &&\
echo -e "/usr/local/gcc/lib64" >> /etc/ld.so.conf.d/gcc.conf&&\
ldconfig -p |grep gcc
gcc安装包路径: https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.gz
具体安装步骤参考:https://blog.csdn.net/pauljjf/article/details/105171154
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。