系统版本:Ubuntu 16.04.5 LTS
软件版本:Docker-CE-18.09.5
硬件配置:无
root@ubuntu:~# sudo apt-get remove docker docker-engine docker.io containerd runc
root@ubuntu:~# sudo apt-get update
root@ubuntu:~# sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
APT-Docker存储库由阿里云开源镜像网提供。
root@ubuntu:~# curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
root@ubuntu:~# sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
root@ubuntu:~# sudo apt-get update
root@ubuntu:~# sudo apt-get -y install docker-ce-{version}
root@ubuntu:~# systemctl start docker
root@ubuntu:~# systemctl enable docker
root@ubuntu:~#-
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-04-23 17:41:12 CST; 1min 36s ago
[root@localhost ~]# vim /etc/docker/daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
[root@localhost ~]# systemctl restart docker
root@ubuntu:~# sudo docker run hello-world
原文:https://www.cnblogs.com/network-ren/p/12377089.html