Docker私有仓库管理
docker load -i registry.tar.gz
docker run -d -p 5000:5000 --restart=always --name registry -v /opt/myregistry:/var/lib/registry registry
docker tag kode:v2 10.0.0.11:5000/kode:v2 给kode:v2打上标签[root@docker1 centos_zabbix]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
10.0.0.11:5000/kode v2 6914fda5fd44 About an hour ago 502MB
kode v2 6914fda5fd44 About an hour ago 502MB
[root@docker1 centos_zabbix]# cat /etc/docker/daemon.json
{"registry-mirrors": ["https://registry.docker-cn.com"],"insecure-registries": ["10.0.0.11:5000"], 这条是支持http协议,默认只支持https协议"live-restore": true 重启docker服务,容器全部退出的解决办法
}[root@docker1 centos_zabbix]# systemctl restart docker
[root@docker1 centos_zabbix]# docker push 10.0.0.11:5000/kode:v2
The push refers to repository [10.0.0.11:5000/kode]
8cfef2e89511: Pushed
d91e224377a7: Pushed
f62f360c3707: Pushed
f8a07a9524ca: Pushed
3e9b714f4415: Pushed
64d86423e2e3: Pushed
a1ca40978f2f: Pushed
b5e11aae8a8e: Pushed
v2: digest: sha256:bba86d3ebe28f028fbe746e2cd0fc59bed9aa7b369bdcccec42088e91407b837 size:1993
页面测试:
查看版本:
[root@docker1 centos_zabbix]# docker tag busybox:latest 10.0.0.11:5000/busybox:latest
[root@docker1 centos_zabbix]# docker push 10.0.0.11:5000/busybox:latest
The push refers to repository [10.0.0.11:5000/busybox]
6194458b07fc: Pushed
latest: digest: sha256:bf510723d2cd2d4e3f5ce7e93bf1e52c8fd76831995ac3bd3f90ecc866643aff size: 527
下载镜像:
[root@docker2 ~]# cat /etc/docker/daemon.json
{
"insecure-registries": ["10.0.0.11:5000"]
}
之后重启docker,并下载镜像:
[root@docker2 ~]# docker run -d -p 80:80 10.0.0.11:5000/kode:v2 这里是可以直接运行,但是需要先下载镜像
Unable to find image '10.0.0.11:5000/kode:v2' locally
v2: Pulling from kode
993c50d47469: Already exists
e96bb0f2ed55: Pull complete
95647a6b9915: Pull complete
1d780b852b28: Pull complete
15caef2b2cf8: Pull complete
da519f134b0b: Pull complete
831074bbccbf: Pull complete
2662dec0af9c: Pull complete
Digest: sha256:bba86d3ebe28f028fbe746e2cd0fc59bed9aa7b369bdcccec42088e91407b837
Status: Downloaded newer image for 10.0.0.11:5000/kode:v2
6ed4f35cb60e09f753ba94566d7e529565e07a2a07239d3790718ba6919b23c5
[root@docker2 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ed4f35cb60e 10.0.0.11:5000/kode:v2 "/bin/bash /init.sh" 4 seconds ago Up 3 seconds 0.0.0.0:80->80/tcp jovial_heisenberg
打开网页测试:
创建带自动认证base的功能
##带basic认证的registry
yum install httpd-tools -y
mkdir /opt/registry-var/auth/ -p
htpasswd -Bbn oldboy 123456 >> /opt/registry-var/auth/htpasswddocker run -d -p 5000:5000 -v /opt/registry-var/auth/:/auth/ -v /opt/myregistry:/var/lib/registry -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" registry
转载于:https://www.cnblogs.com/nsh123/p/11137806.html
Docker私有仓库管理相关推荐
- Docker私有仓库管理,删除本地仓库中的镜像
一:Docker私有仓库安装 1. 下载镜像是有镜像仓库: [root@localhost ~]# systemctl start docker#如果已经有镜像了,强制删除原来的镜像的方式如下: [r ...
- docker私有仓库,仓库管理器
目录 1.简单私有仓库管理 1.概述 2.上传镜像到私有仓库 3.从私有仓库拉取镜像 2.基于Docker搭建Nexus构建Docker私服 1.下载nexus3的镜像 2.启动容器 3.登录管理平台 ...
- 企业级docker私有仓库的配置与使用
1 搭建Harbor企业级docker仓库 搭建docker私有仓库是企业在docker使用中必不可少的步骤,harbor是由vmware几个大神开源出来的一款非常优秀的产品.因此今天来讲述一下如何在 ...
- 客快物流大数据项目(十八):Docker私有仓库
目录 Docker私有仓库 一.registry 的搭建 1.搭建 2.验证
- Docker学习笔记 — Docker私有仓库搭建
2019独角兽企业重金招聘Python工程师标准>>> 和Mavan的管理一样,Dockers不仅提供了一个中央仓库,同时也允许我们使用registry搭建本地私有仓库. 使用私有仓 ...
- Docker 私有仓库最简便的搭建方法
http://blog.csdn.net/wangtaoking1/article/details/44180901/ Docker学习笔记 - Docker私有仓库搭建 http://www.jia ...
- (六)构建Docker私有仓库、Gitlab仓库和持续集成环境
环境说明 IP 功能 eth0:192.168.124.139 eth1:172.16.100.10 Docker私有仓库.Gitlab.持续集成 eth0:192.168.124.138 eth1: ...
- 部署docker-consul群集,Harbor构建Docker私有仓库
文章目录 部署docker-consul群集,Harbor构建Docker私有仓库 了解Harvor 案例概述 Docker consul服务了解 部署Harbor服务过程 不是本地上传镜像操作 在用 ...
- 使用Harbor构建docker私有仓库
目录 一.概述 1.什么是Harbor 2.Harbor的优势 3.Docker私有仓库架构 4.Harbor 配置文件以及相关参数 (1)所需参数 (2)可选参数 二.使用Harbor构建docke ...
最新文章
- 巧用CSS的alpha滤镜
- c语言NULL和0区别
- Windows Azure Storage (6) Windows Azure Storage之Table
- 数据库简单的实际运用 ①
- LLBL Gen 3.x 源代码追踪与解析 Type Converter 类型转换器
- Python工程师必看的面试问题与解答(中) 1
- c语言 存储,c语言存储类
- ICML 2019 | 强化学习用于推荐系统,蚂蚁金服提出生成对抗用户模型(附论文下载链接)...
- 微信浏览器视频自动播放
- 卷积神经网络原理简述
- 抖音网红穿的服装品牌,那些爆款女装号都是怎么拍的呢?
- mysql pdf教程_MySQL5.7从入门到精通(刘增杰 著)带书签完整版PDF[230MB]
- python 仪表盘 ppt_Python之pyecharts数据可视化,词云图,仪表盘!
- undefined reference to `timersub‘ 错误处理
- Stata——固定效应模型、随机效应模型、混合效应模型(区别、实例)
- 宝付旅行记二(宁夏银川)
- 写给 Java 程序员的前端 Promise 教程
- 深入理解 spring-boot-starter-parent
- 蜘蛛seo超级外链软件
- Chrome Console 小技巧之 01 如何启动XHR监控网络请求