「Docker」- 安装(Debian) @20210121
Docker 19.03.13 on Debian GNU/Linux 10 (buster)
Install Docker Engine on Debian | Docker Documentation
#### 卸载旧版 Docker 服务
systemctl stop docker.service # 18.09.1
apt-get remove docker.io runc
#### 安装仓库
apt-get update
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
#### 安装 Docker 服务
apt-get update
apt-cache madison docker-ce # 查看版本
apt-get install docker-ce=5:19.03.13~3-0~debian-buster \
docker-ce-cli=5:19.03.13~3-0~debian-buster \
containerd.io
# apt-get install docker-ce docker-ce-cli containerd.io
Docker 19.03.12 on Ubuntu 18.04.4 LTS
Install Docker Engine on Ubuntu | Docker Documentation
# 移除旧版
apt-get remove docker docker-engine docker.io containerd runc
# 添加官方仓库
apt-get update
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88 # 验证
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# 安装服务
apt-get update
apt-get install -y docker-ce=5:19.03.12~3-0~ubuntu-bionic \
docker-ce-cli=5:19.03.12~3-0~ubuntu-bionic \
containerd.io
# 服务自动启动
systemctl start docker.service
systemctl enable docker.service
systemctl status docker.service
# 测试
docker run --rm hello-world
Docker 19.03.12 on Ubuntu 20.04.4 LTS
Install Docker Engine on Ubuntu | Docker Documentation
# 移除旧版
apt-get remove docker docker-engine docker.io containerd runc
# 添加官方仓库
apt-get update
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88 # 验证
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# 安装服务
apt-get update
apt-get install -y docker-ce=5:20.10.1~3-0~ubuntu-focal \
docker-ce-cli=5:20.10.1~3-0~ubuntu-focal \
containerd.io
# 服务自动启动
systemctl start docker.service
systemctl enable docker.service
systemctl status docker.service
# 测试
docker run --rm hello-world
参考文献
WikiNotes/安装(Debian)
docker docs/About Docker CE
浙公网安备 33010602011771号