下载
下载路径:https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/
下载版本
离线安装docker需要下载3个包,containerd.io ,docker-ce-cli,docker-cecontainerd.io_1.2.6-3_amd64.debdocker-ce_19.03.9_3-0_ubuntu-xenial_amd64.debdocker-ce-cli_19.03.9_3-0_ubuntu-xenial_amd64.deb
安装
下载完毕后拷贝到ubuntu上用 dpkg 命令安装,安装顺序:先安装 containerd.io 跟 docker-ce-cli,最后安装docker-ce,命令:sudo
dpkg
-i xxxx.deb依次执行安装,顺序不能改变
1 2 3
| dpkg -i containerd.io_1.2.6-3_amd64.deb dpkg -i docker-ce-cli_19.03.9_3-0_ubuntu-xenial_amd64.deb dpkg -i docker-ce_19.03.9_3-0_ubuntu-xenial_amd64.deb
|
启动
systemctl start dockersystemctl status docker
设置自启动
# 设置 docker自动启动systemctl enable docker.service# 查看docker 在系统中状态systemctl list-unit-files |grep docker
设置加速
1 2 3 4 5 6 7 8 9 10 11 12 13
| # 添加加速镜像 cd /etc mkdir docker cd /etc/docker vim daemon.json # 将下面复制到daemon.json文件中 https://registry.docker-cn.com { "registry-mirrors": ["https://81zkznk0.mirror.aliyuncs.com"] }
# 重启docker systemctl restart docker.service
|