Docker本地私有仓库搭建:
准备两台服务器192.168.10.123,192.168.10.124
1.以容器的方式运行registry服务,在123服务器执行
docker run -idt -p 5000:5000 --name registry -v /data/registry:/data/docker/registry registry
启动成功后,使用docker ps查看进程
[root@localhost build]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 63a8ef84f969 registry "docker-registry" 30 minutes ago Up 30 minutes 0.0.0.0:5000->5000/tcp registry f769894476dd docker.io/redis "/entrypoint.sh redi About an hour ago Up About an hour 6379/tcp serene_jones 13f2081c739c docker.io/redis "/entrypoint.sh redi About an hour ago Up About an hour 6379/tcp distracted_pasteur 7458914dbedf docker.io/redis "/entrypoint.sh redi About an hour ago Up About an hour 6379/tcp determined_poincare 4a48ec12cbb7 docker.io/redis "/entrypoint.sh redi About an hour ago Up About an hour 6379/tcp determined_cori
2.切换到124服务器
从官方仓库下载Redis镜像
并推送到本地仓库中
[root@localhost docker]# docker pull docker.io/redis latest: Pulling from docker.io/redis 9d3ceacde91b: Pull complete bbe78c1a5a53: Pull complete 9bce9474876b: Pull complete 047a294381b2: Pull complete 2658b5be63c6: Pull complete 7bf6d72c51dd: Pull complete 6d6a6cf52058: Pull complete aa2530999d9d: Pull complete e1826fa7683c: Pull complete 6f363001266d: Pull complete 836d921b3cd8: Pull complete 2a7c655ad485: Pull complete 24968be6ba8d: Pull complete 61ccddfbf92f: Pull complete e352ded77489: Pull complete 43d77a7c6a43: Pull complete 9216d5a4eec8: Already exists docker.io/redis:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:ab962e0e648f99bd328dcca1ef0bef2da2f896fa7404d963a90a1308ef6235cc Status: Downloaded newer image for docker.io/redis:latest
修改/etc/sysconfig/docker配置文件,添加--insecure-registry参数
[root@localhost docker]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker
# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --insecure-registry 192.168.100.123:5000'
DOCKER_CERT_PATH=/etc/docker
重启124服务器上的Docker服务
[root@localhost docker]# systemctl restart docker
[root@localhost docker]# systemctl status docker
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
Drop-In: /usr/lib/systemd/system/docker.service.d
└─flannel.conf
Active: active (running) since Mon 2015-09-07 12:20:33 CST; 1min 39s ago
Docs: http://docs.docker.com
Main PID: 6010 (docker)
CGroup: /system.slice/docker.service
└─6010 /usr/bin/docker -d --selinux-enabled --insecure-registry 192.168.100.12333:5000 --bip=172.17.2.1/24 --mtu=1472
3.Tag镜像并推送到本地仓库
[root@localhost docker]# docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE docker.io/redis latest 9216d5a4eec8 13 days ago 109.3 MB [root@localhost docker]# docker tag docker.io/redis 192.168.100.123:500/qx/redis [root@localhost docker]# docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 192.168.100.123:5000/qeeka/redis latest 9216d5a4eec8 13 days ago 109.3 MB docker.io/redis latest 9216d5a4eec8 13 days ago 109.3 MB
[root@localhost docker]# docker push 192.168.100.123:5000/qx/redis The push refers to a repository [192.168.100.123:5000/qx/redis] (len: 1) Sending image list Pushing repository 192.168.100.123:5000/qx/redis (1 tags) 9d3ceacde91b: Image successfully pushed bbe78c1a5a53: Image successfully pushed 9bce9474876b: Image successfully pushed 047a294381b2: Image successfully pushed 2658b5be63c6: Image successfully pushed 7bf6d72c51dd: Image successfully pushed 6d6a6cf52058: Image successfully pushed aa2530999d9d: Image successfully pushed e1826fa7683c: Image successfully pushed 6f363001266d: Image successfully pushed 836d921b3cd8: Image successfully pushed 2a7c655ad485: Image successfully pushed 24968be6ba8d: Image successfully pushed 61ccddfbf92f: Image successfully pushed e352ded77489: Image successfully pushed 43d77a7c6a43: Image successfully pushed 9216d5a4eec8: Image successfully pushed Pushing tag for rev [9216d5a4eec8] on {http://192.168.100.123:5000/v1/repositories/qx/redis/tags/latest}
相关推荐
docker有公共仓库,相当于在...所以有两个应对策略,第一个就是使用daocloud加速器,第二个就是本地搭建私有仓库,当从公共仓库中pull下来的镜像,存到本地私有仓库,下次还需要使用直接从本地下载,那速度就快很多了。
和Mavan的管理一样,Dockers不仅提供了一个中央仓库,同时也允许我们使用registry搭建本地私有仓库。 使用私有仓库有许多优点: 节省网络带宽,针对于每个镜像不用每个人都去中央仓库上面去下载,只需要从私有仓库...
docker私有仓库在虚拟机上创建私有仓库,环境centos6.0
离线搭建docker私有镜像仓库软件包 教程参见https://blog.csdn.net/qq_38120778/article/details/124277294
主要介绍了Docker Registry 私有仓库搭建的相关资料,需要的朋友可以参考下
Dockerfile 指令与 Docker-compose 容器编排-搭建 docker 私有仓库 本文档主要讲解了 Dockerfile 指令、Docker-compose 容器编排、搭建 docker 私有仓库等内容。以下是相关知识点的总结: 一、Dockerfile 指令 ...
docker的应用的搭建与应用,每个搭建安装的方式都有命令和解释,docker的安装,设置ustc的镜像,Docker的启动与停止,常用命令,docker的网络类型,迁移与备份,Dockerfile编写和语法,Docker私有仓库的搭建和链接
2、提供镜像资源利用,针对公司内部使用的镜像,推送到本地的私有仓库,供公司内部的人员使用。 环境准备: 两台装有docker的Centos7虚拟机(尽量保证docker的版本都一致) 虚拟机一:192.168.0.124 ...
本篇文章主要介绍了Centos 7中Docker私有仓库的搭建方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
主要介绍了详解docker私有仓库搭建与使用实战,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
centos7下安装docker和私有仓库,在自己单位搭建完成,以此为例,给大家借鉴。
本篇文章主要介绍了Docker搭建本地私有仓库的详细步骤,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
本篇文章主要介绍了docker创建私有镜像仓库搭建教程,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧