FROM centos:7.9.2009
# Install basic dependencies
RUN yum -y install gcc gcc-c++ \
gdb \
make \
valgrind \
vim \
wget \
bzip2
ADD ./gcc-5.5.0.tar.gz /usr/local/src
ADD ./CMake-3.10.3.tar.gz /usr/local/src
#boost's lib path
ADD ./boost_1_63_0_static.tar.gz /usr/local/lib64
#install cmake
RUN cd /usr/local/src/CMake-3.10.3 \
&& ./bootstrap \
&& make -j6 \
&& make install
#download_prerequisites是下载依赖,很关键
RUN cd /usr/local/src/gcc-5.5.0 && ./contrib/download_prerequisites \
&& mkdir -p gcc-build-5.5.0 && cd gcc-build-5.5.0 \
&& /usr/local/src/gcc-5.5.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib \
&& make -j8 \
&& make install \
&& cd /usr/bin/ \
&& mv gcc gcc_back \
&& mv g++ g++_back \
&& ln -s /app/gcc-5.5.0/bin/gcc gcc \
&& ln -s /app/gcc-5.5.0/bin/g++ g++
# Set the default command to execute when the container starts
CMD ["/bin/bash", "--login", "-cex"]
标签:gcc,5.5,make,centos7.9,usr,&&,gcc5.5,boost1.63,local
From: https://www.cnblogs.com/huangshiyi/p/17171786.html