Docker

Docker #

使用 #

# 停止 docker
systemctl stop docker.socket

安装 #

# 使用网易镜像源
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://mirrors.163.com/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker-163.asc
sudo chmod a+r /etc/apt/keyrings/docker-163.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker-163.asc] https://mirrors.163.com/docker-ce/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker-163.list > /dev/null
sudo apt-get update

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

安装指定版本 docker #

# List the available versions:
apt-cache madison docker-ce | awk '{ print $3 }'

# 5:20.10.16~3-0~ubuntu-jammy
# 5:20.10.15~3-0~ubuntu-jammy
# 5:20.10.14~3-0~ubuntu-jammy
# 5:20.10.13~3-0~ubuntu-jammy

VERSION_STRING=5:20.10.13~3-0~ubuntu-jammy
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-compose-plugin

设置镜像源 #

cat << 'EOF' > /etc/docker/daemon.json
{
  "experimental": false,
  "debug": true,
  "registry-mirrors": [
    "https://docker.1panel.live",
    "https://hub.rat.dev",
    "https://docker.anyhub.us.kg",
    "https://docker.chenby.cn",
    "https://dockerhub.jobcher.com",
    "https://docker.awsl9527.cn",
    "https://docker.m.daocloud.io"
  ]
}
EOF

systemctl restart docker

本文访问量

本站总访问量

本站总访客数