效果
操作时间 2020-11-10 23:32
检查系统,配置 Base,epel,docker源,安装基础软件
# uname -a
Linux localhost.localdomain 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# yum install -y yum-utils device-mapper-persistent-data lvm2
# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# yum makecache fast
# ll
total 12
drwxr-xr-x. 2 root root 237 Nov 11 05:59 backup
-rw-r--r--. 1 root root 2523 Jun 16 2018 CentOS-Base.repo
-rw-r--r--. 1 root root 2640 Mar 16 2020 docker-ce.repo
-rw-r--r--. 1 root root 664 May 11 2018 epel.repo
安装Docker软件
# yum -y install docker-ce
配置 Docker Registry Mirrors
# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://pee6w651.mirror.aliyuncs.com"]
}
上面的镜像地址应该是某位老哥分享的自己的阿里加速地址,在我安装环境的时候是可用的,但可能在今后失效。
附注一个中科大的地址,未验证:https://docker.mirrors.ustc.edu.cn
# systemctl daemon-reload
# systemctl restart docker
# docker search ubuntu
# docker pull ubuntu
# docker run -i -t ubuntu /bin/bash
root@c696167f864f:/# ls
bin boot dev etc home lib lib32 lib64 libx32 media mnt opt proc root run sbin srv sys tmp usr var
root@c696167f864f:/#exit
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c696167f864f ubuntu "/bin/bash" About a minute ago Exited (0) 10 seconds ago blissful_feistel
# ls /
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var