按官网提示是可以安装成功的,但是curl无法使用https下载,会造成下述语句执行失败
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
使用以下语句,这将安装所需的软件包以支持通过 HTTPS 进行软件包管理操作。
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
随后用sudo apt update更新一下,即可。
安装最近的docker 版本:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
配置文件 /etc/docker/daemon.json:
配置文件 /etc/docker/daemon.json:
增加配置内容:
{
"registry-mirrors": [
"https://dockerproxy.com",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
]
}
systemctl restart docker
检查配置是否生效
docker info