Docker搭建私有仓库

Docker搭建私有仓库

一、私有仓库搭建

sh 复制代码
# 1、拉取私有仓库镜像
docker pull registry
# 2、启动私有仓库容器
docker run --name=registry -p 5000:5000 registry
# 3、打开浏览器输入 http://你的服务器地址:5000/v2/_catalog 看到 {"repositories":[]} 表示搭建成功
# 3、比如我的是:http://192.168.198.139:5000/v2/_catalog
# 4、修改daemon.json
vim /etc/docker/daemon.json
{
  "insecure-registries": ["私有仓库服务器IP:5000"]
}
# 5、重启docker服务
systemctl restart docker
docker start registry
docker start gallant_moore

修改daemon.json

推送完成后看到的是这样的

刷新浏览器

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

sh 复制代码
# 1、将镜像为私有仓库的镜像
docker tag centos:7 私有仓库服务器:5000/centos:7
# 2、将镜像推送
docker push 镜像名
docker push 192.168.198.139:5000/mysql

三、拉取镜像

sh 复制代码
# 拉取镜像
docker pull 端口地址:端口号/镜像名称:版本号
# 事例
docker pull 192.168.198.139:5000/mysql:latest
相关推荐
SelectDB4 小时前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
曲幽11 小时前
别再用网页翻译看源码了!你的私人翻译神器LibreTranslate,部署避坑指南来了
python·docker·web·pot·translate·libretranslate·arogstranslate
XIAOHEZIcode2 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220702 天前
如何搭建本地yum源(上)
运维
武子康2 天前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
大树885 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠5 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质5 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
Inhand陈工5 天前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信
Alsn865 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker