安装

apt-get update
apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get -y update
apt-get -y install docker-ce

docker version

国内镜像

mac

"registry-mirrors" : [
"https://qhmz3eak.mirror.aliyuncs.com"
],

ubuntu

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://qhmz3eak.mirror.aliyuncs.com"],
"graph": "/work/soft/docker/cache"
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker