Docker
Installation
# Debian 10 (Buster)
# https://docs.docker.com/engine/install/debian/
sudo apt-get remove docker \
docker-engine \
docker.io \
containerd \
runc
sudo apt-get update
sudo apt-get install --no-install-recommends \
--yes \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"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
sudo apt-get update
# 列出版本
apt-cache madison docker-ce | awk '{ print $3 }'
# 选择版本
VERSION_STRING=5:20.10.0~3-0~debian-buster
sudo apt-get install --no-install-recommends \
--yes \
docker-ce \
docker-ce-cli \
containerd.io \
docker-compose-plugin
apt-get autoremove --yes
# 配置镜像
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": [
"https://registry.cn-hangzhou.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com",
"http://f1361db2.m.daocloud.io"
]
}
EOF
systemctl restart docker
# 查看配置
cat /etc/docker/daemon.json
Uninstallation
sudo apt-get purge docker-ce \
docker-ce-cli \
containerd.io \
docker-compose-plugin
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
标签:10,get,--,sudo,apt,Debian,install,Docker,docker
From: https://www.cnblogs.com/newhappy98/p/16831164.html