debian-docker安装
debian docker 安装
docker官方文档:https://docs.docker.com/engine/install/debian/
参考官方文档,傻瓜式安装
服务器:debian11
这边采用apt安装docker源的方式
Step1:删除旧版本
1 | apt-get remove docker docker-engine docker.io containerd runc |
images, containers, volumes, networks保存在/var/lib/docker/目录,apt remove并不会删除。
Step2:更新安装相关依赖
1 | sudo apt-get update |
Step3:apt安装docker源
添加docker官方GPG密钥
1
2mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpgapt添加docker源
1
2
3echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step4:docker engine安装
最新版
1
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
历史版本
1
2
3
4
5
6
7
8
9
10List the available versions:
apt-cache madison docker-ce | awk '{ print $3 }'
5:18.09.1~3-0~debian-stretch
5:18.09.0~3-0~debian-stretch
18.06.1~ce~3-0~debian
18.06.0~ce~3-0~debian
VERSION_STRING=5:18.09.0~3-0~debian-stretch
apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-compose-plugin
Step5:更新
同Step4
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Deneb!
评论




