基于centos7.6 docker镜像升级GCC至6.5版本

 

 

 

 

 

 

 

 

附上最终的Dockerfile:

#OS:        Centos
#Version:   centos7.6
#Author:    local.prop

FROM docker.io/centos:​centos7.6.1810
​
ENV http_proxy=xxx.xxx.xxx:8888
ENV https_proxy=xxx.xxx.xxx:8888
#ENV APT_PROXY=Acquire::http::proxy\ \"http://xxx.xxx.xxx:8888\"\;\nAcquire::https::proxy\ \"https://xxx.xxx.xxx:8888\"\;
ENV WGET_HTTP_PROXY="http_proxy = xxx.xxx.xxx:8888"
ENV WGET_HTTPS_PROXY="https_proxy = xxx.xxx.xxx:8888"
​
RUN export http_proxy=$http_proxy
RUN export https_proxy=$https_proxy
RUN echo 'proxy=http://xxx.xxx.xxx:8888'>>/etc/yum.conf
RUN echo '[http_proxy]'>/root/.hgrc && echo 'xxx.xxx.xxx:8888'>>/root/.hgrc
​
#RUN echo $APT_PROXY > /etc/apt/apt.conf
########## install project packages ##########
RUN yum groupinstall -y "Development tools"
RUN yum update -y  && yum groupinstall -y "Development tools" && yum install -y \
        wget \
        vim \
        bzip2 \
        gcc \
        make \
        glibc-devel.i686 \
        libgcc.i686 \
        gcc-c++ \
        cmake
​
RUN echo 'use_proxy=yes' > /etc/wgetrc && echo 'http_proxy=http://xxx.xxx.xxx:8888' >> /etc/wgetrc
​
WORKDIR /root/source

RUN wget http://ftp.gnu.org/gnu/gcc/gcc-6.5.0/gcc-6.5.0.tar.gz && \
    tar -zvxf gcc-6.5.0.tar.gz --remove-files && cd gcc-6.5.0 && \
    sed -i 's/ftp:\/\/gcc.gnu.org\/pub\/gcc\/infrastructure/http:\/\/mirror.linux-ia64.org\/gnu\/gcc\/infrastructure/g' contrib/download_prerequisites && \
    ./contrib/download_prerequisites && \
    ./configure --disable-multilib && \
    make -j`nproc` && \
    make install -j`nproc` && \
    cd .. && \
    rm -rf gcc-6.5.0
    
#RUN wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
	#tar xf yasm-1.3.0.tar.gz --remove-files && \
	#cd yasm-1.3.0 && \
	#./configure && \
	#make -j`nproc` && \
	#make install && \
	#cd .. && \
	#rm -rf yasm*
    
WORKDIR /root

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值