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

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

相关推荐
李狗蛋儿啊1 小时前
zero自动化框架搭建---Git安装详解
运维·git·自动化
小金的学习笔记2 小时前
如何在本地和服务器新建mysql用户和密码
运维·服务器·mysql
s_fox_2 小时前
nginx ngx_http_module(7) 指令详解
运维·nginx·http
EasyNVR2 小时前
EasyRTC智能硬件:实时畅联、沉浸互动、消音护航
运维·服务器·网络·安全·音视频·webrtc·p2p
CarryBest2 小时前
Jenkins 环境搭建---基于 Docker
运维·jenkins
若云止水3 小时前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_process_options
运维·nginx
s_fox_3 小时前
nginx ngx_http_module(9) 指令详解
运维·nginx·http
_院长大人_4 小时前
Docker Mysql 数据迁移
mysql·adb·docker
xing.yu.CTF5 小时前
Web入侵实战分析-常见web攻击类应急处置实验2
运维·服务器·windows·web安全·apache·php漏洞·phpstudy后门漏洞
我们的五年5 小时前
【Linux网络】TCP/IP地址的有机结合(有能力VS100%???),IP地址的介绍
linux·运维·网络·tcp/ip