欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 培训 > Ubuntu24.04下的docker问题

Ubuntu24.04下的docker问题

2025/5/2 1:02:56 来源:https://blog.csdn.net/lm19770429/article/details/143933805  浏览:    关键词:Ubuntu24.04下的docker问题

   按官网提示是可以安装成功的,但是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

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词