docker hub镜像加速

1、环境准备

准备一台能访问docker.io的机器,我这里使用windows服务器

安装docker windows环境
https://learn.microsoft.com/zh-cn/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce
https://docs.docker.com/desktop/install/windows-install/

2、安装完成后启动图形界面

3、运行registry 容器

cmd 运行里执行

bash 复制代码
docker run -d -p 5000:5000 --name registry -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io registry:2

4、设置docker 使用registry pull镜像(ip为你跑registry的皮的地址)

bash 复制代码
vi /etc/docker/daemon.json
bash 复制代码
{
  "insecure-registries": ["ip:5000"],
  "registry-mirrors": ["http://ip:5000"]
}

重启docker

bash 复制代码
 sudo systemctl daemon-reload
 sudo systemctl restart docker

5、设置podman 使用registry pull镜像(ip为你跑registry的皮的地址)

bash 复制代码
vi /etc/containers/registries.conf
bash 复制代码
unqualified-search-registries = ["docker.io"]

[[registry]]
prefix = "docker.io"
location = "ip:5000"
insecure = true

重启podman

bash 复制代码
sudo systemctl daemon-reload
sudo systemctl restart podman

全部完成后就可以直接拉取镜像了

相关推荐
java_logo13 分钟前
Docker 部署 Rocky Linux 全流程教程
linux·运维·服务器·docker·容器·1024程序员节
2501_9387918317 分钟前
服务器镜像安全:Docker 镜像漏洞扫描(Trivy)与基础镜像优化
服务器·安全·docker
老司机张师傅1 小时前
【微服务实战之Docker容器】第十章-compose容器编排
docker·微服务·架构
ghie90901 小时前
利用 Docker 和 Kubernetes 实现微服务部署
docker·微服务·kubernetes
0wioiw01 小时前
Ubuntu(⑤Redis)
linux·运维·ubuntu
我爱钱因此会努力1 小时前
ansible实战-不同的用户登录不同的主机
linux·运维·服务器·ansible
Wang's Blog1 小时前
Linux小课堂: 系统核心技能与应用总结与进阶指南
linux·运维·服务器
wa的一声哭了2 小时前
Mac os安装Easyconnect卡在正在验证软件包
运维·服务器·git·macos·eclipse·github·mac
不像程序员的程序媛2 小时前
Linux本机ping虚机ip Network unreachable
linux·运维·tcp/ip