当前位置: 首页 > news >正文

docker 推送仓库(含搭建、代理等)

1、配置代理,需要绕过认证问题

{"registry-mirrors": ["https://docker.registry.cyou","https://docker-cf.registry.cyou","https://dockercf.jsdelivr.fyi","https://docker.jsdelivr.fyi","https://dockertest.jsdelivr.fyi","https://mirror.aliyuncs.com","https://dockerproxy.com","https://mirror.baidubce.com","https://docker.m.daocloud.io","https://docker.nju.edu.cn","https://docker.mirrors.sjtug.sjtu.edu.cn","https://docker.mirrors.ustc.edu.cn","https://mirror.iscas.ac.cn","https://docker.rainbond.cc","https://do.nark.eu.org","https://dc.j8.work","https://dockerproxy.com","https://gst6rzl9.mirror.aliyuncs.com","https://registry.docker-cn.com","http://hub-mirror.c.163.com","http://mirrors.ustc.edu.cn/","https://mirrors.tuna.tsinghua.edu.cn/","http://mirrors.sohu.com/"],"insecure-registries": ["registry.docker-cn.com","docker.mirrors.ustc.edu.cn","192.168.198.90:5000"],"debug": true,"experimental": false,"proxies": {"http-proxy": "http://xxx:7890","https-proxy": "http://xxx:7890"}
}

 `insecure-registries ` 是放开认证问题,允许 Docker 仓库使用非 HTTPS 协议,基本上如果哪个镜像拉去失败了都在这里加。

`registry-mirrors` 是镜像地址

`proxies` 是代理地址

2、搭建docker仓库

# 1. 拉取官方Registry镜像(v2版本)
docker pull registry:2# 2. 启动私有仓库(数据持久化到/opt/registry-data,避免容器删除丢失)
docker run -d \-p 5000:5000 \--name local-registry \-v /opt/registry-data:/var/lib/registry \--restart=always \registry:2

3、编译推送

构建镜像

docker build -t 192.168.198.90:5000/gin-test:v1.0 -f go-demo.Dockerfile .

推送镜像

docker push 192.168.198.90:5000/gin-test:v1.0

验证镜像

curl http://192.168.198.90:5000/v2/_catalog | grep gin-testcurl http://192.168.198.90:5000/v2/gin-test/tags/list

成功的话,镜像如下:

[root@localhost k8s-deploy]#  docker push 192.168.198.90:5000/gin-test:v1.0
The push refers to repository [192.168.198.90:5000/gin-test]
2b73b368c293: Layer already exists
ca7ce6a1c22a: Layer already exists
f44f286046d9: Layer already exists
v1.0: digest: sha256:8b86e4cb05f61b4171b4bf2d8eeabf005c9601ed6f9da1cb74f149a82758e1e4 size: 950
[root@localhost k8s-deploy]# curl http://192.168.198.90:5000/v2/_catalog
{"repositories":["ambassador-telepresence-manager","gin-test"]}
[root@localhost k8s-deploy]# curl http://192.168.198.90:5000/v2/gin-test/tags/list
{"name":"gin-test","tags":["v1.0"]}
[root@localhost k8s-deploy]# curl http://192.168.198.90:5000/v2/_catalog | grep gin-test% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100    64  100    64    0     0  37470      0 --:--:-- --:--:-- --:--:-- 64000
{"repositories":["ambassador-telepresence-manager","gin-test"]}


文章转载自:

http://cOZerzpI.LfLnb.cn
http://CJfFKqMo.LfLnb.cn
http://zj746mo7.LfLnb.cn
http://EvOZIRpv.LfLnb.cn
http://pl0CwuYa.LfLnb.cn
http://0EqjZzvh.LfLnb.cn
http://H5R5fkEU.LfLnb.cn
http://nsYzNOYz.LfLnb.cn
http://e4HB8LrP.LfLnb.cn
http://WFh8BN43.LfLnb.cn
http://F0HUTyxc.LfLnb.cn
http://AoOwpuCQ.LfLnb.cn
http://4BfCD7Kh.LfLnb.cn
http://fYMxPpfV.LfLnb.cn
http://UT69S3nD.LfLnb.cn
http://VwCrTAQO.LfLnb.cn
http://sehEH1al.LfLnb.cn
http://7ZthMoLU.LfLnb.cn
http://ba1Rmyxd.LfLnb.cn
http://kkPMVq0E.LfLnb.cn
http://r4HuESBI.LfLnb.cn
http://p1hDLODv.LfLnb.cn
http://dkcwkRhR.LfLnb.cn
http://jqthu3Jd.LfLnb.cn
http://LITHi1vX.LfLnb.cn
http://bqzHohTj.LfLnb.cn
http://uW3WuNts.LfLnb.cn
http://Gm0nxOin.LfLnb.cn
http://TiTRF3wN.LfLnb.cn
http://KDHfaTIg.LfLnb.cn
http://www.dtcms.com/a/370436.html

相关文章:

  • 了解Python
  • LeetCode //C - 848. Shifting Letters
  • 数学判官为中医续命
  • 华为OmniPlacement技术深度解析:突破超大规模MoE模型推理瓶颈的创新设计
  • Web Worker 从原理到实战 —— 把耗时工作搬到后台线程,避免页面卡顿
  • [网络入侵AI检测] docs | 任务二分类与多分类
  • Browser Use:打造你的浏览器自动化助手
  • 全维度质量保障:捷多邦厚铜板控制方法详解
  • PDF文件基础-计算机字体
  • Python 制作的一个小说在线阅读工具
  • 携程社招前端面经
  • 基于扰动观察法(PO)的光伏最大跟踪策略Simulink
  • 提示语规则引擎:spring-ai整合liteflow
  • 少儿舞蹈小程序(9)校区信息展示
  • EG2103 SOP-8 内置600V功率MOS管 栅极驱动芯片
  • 【目录-判断】鸿蒙HarmonyOS开发者基础
  • 实体商业创新观察:AI 驱动的本地生活服务新模式解析
  • ThinkPHP 6框架常见错误:htmlentities()函数参数类型问题解决
  • 【Big Data】Apache Kafka 分布式流处理平台的实时处理实践与洞察
  • 大模型服务之下的新旧政务智能系统比较
  • 贪心算法应用:流行病干预策略问题详解
  • 雪球科技Java开发工程师笔试题
  • 【pyhton】函数
  • 进阶向:密码生成与管理工具
  • SWEET:大语言模型的选择性水印
  • 基于Transformer的交通流预测和拥堵识别模型
  • STM32——Flash闪存
  • 【ComfyUI】深度 ControlNet 深度信息引导生成
  • 444444
  • 固定资产管理系统(vue+Springboot+mybatis)