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

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

相关推荐
悠悠1213812 分钟前
微服务通信别只看性能:REST 与 gRPC 的 6 个选型判断和一次 502 故障复盘
运维·服务器
zx_741484812 小时前
【Linux入门】Shell 函数、正则表达式与文本处理:cut 与 awk
linux·运维·正则表达式
Zenova EdgeOS2 小时前
Linux dmesg 工业边缘实战:内核日志过滤、持久化与故障定位
linux·运维·边缘计算·工业边缘·dmesg·内核日志
九皇叔叔2 小时前
K8S 资源菜单
docker·容器·kubernetes·k8s
wdfk_prog3 小时前
ROS教程08:从 TransportTCP::connect() 追到 TCPROS Connection Header、序列化与 Socket 数据传输
运维·缓存·docker·容器·ros
Zhu7583 小时前
docker环境快速部署postgresql数据库18及以上版本
postgresql·容器
做运维的阿瑞3 小时前
Python 标准库汇总:分类速览与常用模块清单
linux·运维·python
zoutao984 小时前
Gitea Actions 自定义 Runner 镜像与自动化部署实战
ci/cd·docker·gitea
日常筹谋记4 小时前
自动化仓储安全防护工况评估:明治传感器AS-33C技术适配性分析
大数据·运维·创业创新·业界资讯
Shadow(⊙o⊙)5 小时前
Linux进阶知识1.0
linux·运维·服务器