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

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

相关推荐
君穆南3 小时前
基于 NFS 与 Rsync 实现跨服务器 Seafile 数据平滑迁移实战
linux·运维·git
bloglin999993 小时前
scp、rsync远程文件同步
linux·运维·服务器
迦南的迦 亚索的索3 小时前
LINUX环境
linux·运维·服务器
yuanjj883 小时前
linux下调试域格CLM920 NC5等9x07平台模块 QMI拨号
linux·运维·服务器
IMPYLH3 小时前
Linux 的 printenv 命令
linux·运维·服务器·bash
SilentSamsara4 小时前
SSH 远程管理:密钥登录 + 隧道转发,一次性配置好
linux·运维·服务器·ubuntu·centos·ssh
冷色系里的一抹暖调5 小时前
OpenClaw Docker部署避坑指南:服务启动成功但网页打不开?
人工智能·docker·容器·openclaw
Cx330❀5 小时前
Linux命名管道(FIFO)通信:从原理到实操,一文搞懂跨进程通信
大数据·linux·运维·服务器·elasticsearch·搜索引擎
嵌入式×边缘AI:打怪升级日志5 小时前
嵌入式Linux应用开发快速入门(从零到第一个程序)
linux·运维·notepad++
AI、少年郎5 小时前
MiniMind第 2 篇:破除大模型 “神秘感“, 环境搭建|Win/Linux 本地快速部署
linux·运维·服务器·ai·大模型训练·大模型微调·大模型原理