docker 私有仓库

Docker 私有仓库

一、私有仓库搭建

shell 复制代码
# 1、拉取私有仓库镜像 
docker pull registry
# 2、启动私有仓库容器 
docker run -id --name=registry -p 5000:5000 registry
# 3、打开浏览器 输入地址http://私有仓库服务器ip:5000/v2/_catalog,看到{"repositories":[]} 表示私有仓库 搭建成功
# 4、修改daemon.json   
vim /etc/docker/daemon.json    
# 在上述文件中添加一个key,保存退出。此步用于让 docker 信任私有仓库地址;注意将私有仓库服务器ip修改为自己私有仓库服务器真实ip 
{"insecure-registries":["私有仓库服务器ip:5000"]} 
# 5、重启docker 服务 
systemctl restart docker
docker start registry

二、将镜像上传至私有仓库

shell 复制代码
# 1、标记镜像为私有仓库的镜像     
docker tag centos:7 私有仓库服务器IP:5000/centos:7
 
# 2、上传标记的镜像     
docker push 私有仓库服务器IP:5000/centos:7

三、 从私有仓库拉取镜像

shell 复制代码
#拉取镜像 
docker pull 私有仓库服务器ip:5000/centos:7
相关推荐
好评12414 分钟前
Linux入门:软件包管理、Vim、GCC、Makefile、Git 与 GDB
linux·运维·服务器
Danileaf_Guo7 小时前
256台H100服务器算力中心的带外管理网络建设方案
运维·服务器
拾贰_C8 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
bloglin999999 小时前
启动容器报错ls: cannot access ‘/docker-entrypoint-initdb.d/‘: Operation not permitted
docker·容器·eureka
songjxin9 小时前
离线部署kubernetes v1.34.3
云原生·容器·kubernetes
虹科网络安全9 小时前
艾体宝洞察 | 利用“隐形字符”的钓鱼邮件:传统防御为何失效,AI安全意识培训如何补上最后一道防线
运维·网络·安全
石像鬼₧魂石10 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan10 小时前
linux上面写python3日志服务器
linux·运维·服务器
yBmZlQzJ10 小时前
免费内网穿透-端口转发配置介绍
运维·经验分享·docker·容器·1024程序员节
JH307310 小时前
docker 新手入门:10分钟搞定基础使用
运维·docker·容器