1, 下载registry镜像

sudo docker pull registry

2, 启动镜像

docker run -d --name registry -h registry -p 5000:5000 --privileged=true -v /home/wenbronk/Downloads/docker/repository:/var/lib/registry registry

# 镜像中文件的保存位置, 刚开始没连接对..后来使用exec命令 进行find -name 查找到的

参数说明:
-v /opt/registry:/tmp/registry :默认情况下,会将仓库存放于容器内的/tmp/registry目录下,指定本地目录挂载到容器
–privileged=true
:CentOS7中的安全模块selinux把权限禁掉了,参数给容器加特权,不加上传镜像会报权限错误(OSError: [Errno 13]
Permission denied: ‘/tmp/registry/repositories/liibrary’)或者(Received
unexpected HTTP status: 500 Internal Server Error)错误

3, 修改一下镜像的tag

sudo docker tag busybox 192.168.1.110:5000/wenbronk/busybox

4, 将打了tag的image上传

docker push 192.168.1.117:5000/wenbronk/busybox

  注: 此处可能报错, 我的没有

Error: Invalid registry endpoint https://192.168.1.110:5000/v1/: Get https://192.168.112.136:5000/v1/_ping: dial tcp 192.168.112.136:5000: connection refused. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.112.136:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.112.136:5000/ca.crt

因为Docker从1.3.X之后默认docker registry使用的是https,所以当用docker pull命令下载远程镜像时,如果远程docker registry是非https的时候就会报上面的错误。为了解决这个问题需要在启动docker server时增加启动参数修改docker启动配置文件

vim /etc/sysconfig/docker

Ubuntu下配置文件地址为:/etc/init/docker.conf),增加启动选项(已有参数的在后面追加),之后重启docker

OPTIONS='--insecure-registry 192.168.1.110:5000'    #CentOS 7系统
other_args='--insecure-registry 192.168.1.110:5000' #CentOS 6系统

也可以使用nginx实现一个https链接

注: 此种方法可能不管用, 1.12.x以后没有该配置文件了

那么 在”/etc/docker/“目录下,创建”daemon.json“文件。在文件中写入:

{ "insecure-registries":["192.168.1.110:5000"] }

5, 因为Docker从1.3.X之后,与docker registry交互默认使用的是https,而此处搭建的私有仓库只提供http服务 在docker公共仓库下载一个镜像

docker push 192.168.0.110:/busybox

6, 查询仓库中的镜像

docker search 192.168.0.110:

docker 私有仓库的创建的更多相关文章

  1. nexus3使用docker运行/创建docker私有仓库/maven私有仓库

    version: '3.2' services: nexus3: container_name: nexus3 hostname: nexus3 image: sonatype/nexus3:3.14 ...

  2. win10 下安装docker,创建镜像,push镜像到私有仓库,创建私有仓库,修改镜像仓库地址

    通过连接下载window docker安装文件,https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.ex ...

  3. 搭建docker私有仓库,建立k8s集群

    服务器IP角色分布 192.168.5.2 etcd server 192.168.5.2 kubernetes master 192.168.5.3 kubernetes node 192.168. ...

  4. docker 私有仓库镜像的存储位置

    docker 私有仓库的镜像 是存储在5739360d1030 registry "docker-registry" 3 days ago Up 28 hours 0.0.0.0: ...

  5. Docker 私有仓库建立(加密和用户验证)

    (一)生成证书1.mkdir /certs2.cd /certs 3.生成自签名证书 sudo openssl req -newkey rsa:2048 -new -nodes -x509 -days ...

  6. 搭建docker私有仓库(https)

    1.修改openssl.cnf,支持IP地址方式,HTTPS访问在Redhat7或者Centos系统中,文件所在位置是/etc/pki/tls/openssl.cnf.在其中的[ v3_ca]部分,添 ...

  7. docker 私有仓库简易搭建

    概要 本地私有仓库 局域网私有仓库 总结 概要 docker hub 使用非常方便,而且上面有大量的镜像可以使用. 但是,每次都远程下载镜像速度非常慢,如果能在本地做一个 docker 的仓库,多人协 ...

  8. docker私有仓库-https+nginx

    一.概述 使用的是registry-2.4版本,因为在这个版本开始提供了garbage-collect,能够清理掉blobs,2.1开始提供了api的删除功能,但是只是删除的index并没有释放掉磁盘 ...

  9. docker 私有仓库 harbor docker-compose

    c创建docker私有仓库 docker pull registry:2.1.1 mkdir /opt/registry#mkdir /var/lib/registry docker run -d - ...

随机推荐

  1. RelativeLayout中最底的View一个View.layout_marginBottom无效

    处理一个Dialog,发现RelativeLayout布局下最后一个View的layout_marginBottom会失效. 效果图见: 解决方法为: 在最底或最右的组件后面再加个View吧... 这 ...

  2. (二)从分布式一致性谈到CAP理论、BASE理论

    问题的提出 在计算机科学领域,分布式一致性是一个相当重要且被广泛探索与论证问题,首先来看三种业务场景. 1.火车站售票 假如说我们的终端用户是一位经常坐火车的旅行家,通常他是去车站的售票处购买车票,然 ...

  3. Trystrtofloat

    TryStrToFloat为 ‘+1’和‘-1’和 ‘.1’是可以装换成功的

  4. Windows Phone 放开政策 - 应用内支付(IAP)可加入三方支付

    Windows Phone 应用商店在 今年(2013)11月04号 修改了商店政策 允许公司账户的应用使用三方支付SDK. 通过 App certification requirements cha ...

  5. Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad

    Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad 方法一:安装单独组件 ...

  6. C#之使用AutoUpdater自动更新客户端

    安装NuGet包 在Visio studio中右击解决方案,选择管理NuGet包,搜索安装Autoupdater.NET.Official. 工作简介 从服务器下载包含更新文件的XML文件,从中获取软 ...

  7. Netbeans8.1设置Consola字体并解决中文乱码问题

    netbeans是php非常好用的ide,并且还是免费的!但是好多字体不支持中文,会显示如下乱码: 解决方法如下: 通过修改jre的配置文件成功解决了这个问题. 1. 进入jdk安装目录下/jre/l ...

  8. 基于C#语言MVC框架NPOI控件导出Excel表数据

    控件bin文件下载地址:https://download.csdn.net/download/u012949335/10610726@{ ViewBag.Title = "dcxx" ...

  9. /bin/sh: cc: 未找到命令

    redis 4安装出现 /bin/sh  cc:  未找到命令 解决: yum -y install gcc automake autoconf libtool make

  10. python scapy 网卡抓包

    首先需要安装scapy包,点击下载 from scapy.all import * def pack_callback(packet): print packet.show() if packet[' ...