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
相关推荐
鹤落晴春1 天前
RH124问答3:从命令行管理文件
linux·运维·服务器
guslegend1 天前
大模型驱动大数据SRE智能运维
大数据·运维
遇见火星1 天前
Docker Compose 完全入门:一键启动所有容器
运维·docker·容器·docker compose
小啊曼1 天前
CIO实战方法论_11_组织变革打破部门墙
运维
❀搜不到1 天前
远程服务器codex使用本地cc-switch的deepseek api
运维·服务器
虾壳云官方1 天前
OpenClaw 2.7.9 Windows 一键部署教程:零基础也能搭建 AI 自动化助手
运维·人工智能·windows·自动化·openclaw·openclaw一键部署
江南风月1 天前
WGCLOUD保姆级教程最新版整理
运维·zabbix·运维开发·prometheus·日志审计
志栋智能1 天前
超自动化巡检:知识沉淀与团队协作的新载体
大数据·运维·网络·数据库·人工智能·自动化
vsropy1 天前
Ubuntu网络图标消失问题/有网络问号
linux·运维·ubuntu
fofantasy1 天前
NSK LH12AN 微型导轨技术手册
运维·网络·数据库·经验分享·规格说明书