简体   繁体   English

从Docker内部推送到Docker私有注册表

[英]Push to Docker private registry from inside a docker

I have a Jenkins docker container which has access to main docker socket by mapping its volume described here . 我有一个Jenkins docker容器,可以通过映射此处描述的卷访问主docker套接字。 so I want to push an image to local docker private registry container which as described here , image should be tagged by host name like this: 所以我想推到其描述当地码头工人私有注册容器的图像这里 ,图像应通过主机名这样的标签:

docker tag ubuntu:16.04 localhost:5000/my-ubuntu

localhost is not known inside docker but by using docker gateway ip, docker push image to https and I get this error: 本地主机在docker内部不知道,但是通过使用docker网关ip,docker将映像推送到https并出现以下错误:

+ docker push 172.17.0.1/myalpine
The push refers to repository [172.17.0.1/myalpine]
Get https://172.17.0.1/v2/: read tcp 172.17.0.1:34956->172.17.0.1:443: read: connection reset by peer

Any idea of how to make it not use https or other solution? 是否知道如何使其不使用https或其他解决方案?

If you want to run the connection insecure, you can edit the file /etc/docker/daemon.json and include the following content in it: 如果/etc/docker/daemon.json安全地运行连接,则可以编辑文件/etc/docker/daemon.json并在其中包含以下内容:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM