操作系统:Ubuntu 20.04.6 LTS
更新apt
sudo apt update
删除旧版本docker
sudo apt-get remove docker docker-engine docker.io
安装docker
sudo apt install docker.io
查看docker版本
docker --version
启动docker
- 启动docker
sudo systemctl start docker
- 启用docker
sudo systemctl enable docker
- 查看docker状态
sudo systemctl status docker
停止docker
- 禁用docker
sudo systemctl disable docker
- 停止docker
sudo systemctl stop docker
卸载❓docker
sudo apt-get remove docker docker-engine docker.io
sudo apt-get remove docker.ce
配置docker镜像
打开配置文件
sudo vim /etc/docker/daemon.json
添加国内镜像
daemon.json添加以下配置
{ "registry-mirrors": [ "https://hub-mirror.c.163.com", "https://mirror.baidubce.com", "https://ccr.ccs.tencentyun.com" ] }
重启docker
sudo systemctl daemon-reload sudo systemctl restart docker
查看docker信息
sudo docker info