diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 1f31d0c7..4000bc7c 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -2,9 +2,20 @@ FROM centos:centos6.10 MAINTAINER agapple (jianghang115@gmail.com) -env DOWNLOAD_LINK="http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm" +env DOWNLOAD_LINK="https://download.oracle.com/otn-pub/java/jdk/8u281-b09/89d678f2be164786b292527658ca1605/jdk-8u281-linux-x64.rpm" # install system +# update yum config, fix "centos6.x yum install failure && Determining fastest mirrors slow" problems +COPY yum/ /tmp/ +RUN \ + /bin/cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && \ + /bin/cp -f /tmp/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo && \ + /bin/cp /etc/yum/pluginconf.d/fastestmirror.conf /etc/yum/pluginconf.d/fastestmirror.conf.bak && \ + awk '{ if($0=="enabled=1"){print "enabled=0";} else{print $0;} }' /etc/yum/pluginconf.d/fastestmirror.conf.bak > /etc/yum/pluginconf.d/fastestmirror.conf && \ + /bin/cp /etc/yum.conf /etc/yum.conf.bak && \ + echo 'minrate=1' >> /etc/yum.conf && echo 'timeout=600' >> /etc/yum.conf && \ + yum clean all && yum makecache + RUN \ /bin/cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo 'root:Hello1234' | chpasswd && \ diff --git a/docker/base/yum/CentOS-Base.repo b/docker/base/yum/CentOS-Base.repo new file mode 100644 index 00000000..63ff498c --- /dev/null +++ b/docker/base/yum/CentOS-Base.repo @@ -0,0 +1,66 @@ +# CentOS-Base.repo +# +# The mirror system uses the connecting IP address of the client and the +# update status of each mirror to pick mirrors that are updated to and +# geographically close to the client. You should use this for CentOS updates +# unless you are manually picking other mirrors. +# +# If the mirrorlist= does not work for you, as a fall back you can try the +# remarked out baseurl= line instead. +# + +[base] +name=CentOS-$releasever - Base +failovermethod=priority +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra +baseurl=https://mirrors.aliyun.com/centos-vault/centos/$releasever/os/$basearch/ + https://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/ + https://vault.centos.org/centos/$releasever/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#released updates +[updates] +name=CentOS-$releasever - Updates +failovermethod=priority +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra +baseurl=https://mirrors.aliyun.com/centos-vault/centos/$releasever/updates/$basearch/ + https://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/ + https://vault.centos.org/centos/$releasever/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +failovermethod=priority +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra +baseurl=https://mirrors.aliyun.com/centos-vault/centos/$releasever/extras/$basearch/ + https://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/ + https://vault.centos.org/centos/$releasever/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +failovermethod=priority +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra +baseurl=https://mirrors.aliyun.com/centos-vault/centos/$releasever/centosplus/$basearch/ + https://mirrors.cloud.tencent.com/centos/6.0/centosplus/$basearch/ + https://vault.centos.org/centos/$releasever/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#contrib - packages by Centos Users +[contrib] +name=CentOS-$releasever - Contrib +failovermethod=priority +#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra +baseurl=https://mirrors.aliyun.com/centos-vault/centos/$releasever/contrib/$basearch/ + https://mirrors.cloud.tencent.com/centos/$releasever/contrib/$basearch/ + https://vault.centos.org/centos/$releasever/contrib/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 \ No newline at end of file