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

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

相关推荐
ZHOU_WUYI1 小时前
React与Docker中的MySQL进行交互
mysql·react.js·docker
Will_11301 小时前
如何实现k8s高可用
运维·docker·容器
编程、小哥哥1 小时前
互联网大厂Java面试场景:从缓存到容器化的技术问答
redis·docker·微服务·kubernetes·spring security·java面试·gitlab ci
李白你好1 小时前
H3C网络设备(交换机、路由器、防火墙)常用命令整理
运维·网络·智能路由器
无敌的牛1 小时前
Linux梦开始的地方
linux·运维·服务器
laocui12 小时前
Ubuntu22.04开机运行程序
linux·运维·服务器
卡戎-caryon2 小时前
【Linux网络与网络编程】12.NAT技术&&内网穿透&&代理服务
linux·运维·服务器·网络·网络协议·https
我的老子姓彭2 小时前
LWIP的Socket接口
运维·服务器·网络
朱包林2 小时前
day10-别名-MD5,aide-堡垒机
linux·运维·安全·ubuntu·centos·云计算
GoWjw3 小时前
Linux虚拟文件系统(1)
运维·服务器·数据库