Install docker in Debian

2019-06-01 2871点热度 0条评论

Docker要求Centos系统的内核版本高于3.10,因此在安装前你需要知道你的系统是否支持Docker安装的最低内核要求。

Debian/Ubuntu/Raspbian

如果你过去安装过 docker,先删掉:

apt remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1)

首先安装依赖:

apt-get update
apt-get install ca-certificates curl

信任 Docker 的 GPG 公钥并添加仓库:

install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF

最后安装

apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Jalena

原创内容,转载请注明出处! 部分内容来自网络,请遵守法律适用!

文章评论