安装 Docker-CE

Rocky 9 安装 Docker-CE

wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo

sudo sed -i 's+download.docker.com+mirrors.cloud.tencent.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo

yum makecache

yum install docker-ce -y

cat > /etc/docker/daemon.json << EOF
{
   "registry-mirrors": [
   "https://mirror.ccs.tencentyun.com",
   "https://2cky5149.mirror.aliyuncs.com"
  ]
}
EOF

systemctl start docker
systemctl enable docker
systemctl status docker

Ubuntu 24 安装 Docker-CE

apt-get install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

apt-get update

apt-get install docker-ce

docker --version

systemctl status docker

Last updated