简体   繁体   中英

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 . 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 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?

If you want to run the connection insecure, you can edit the file /etc/docker/daemon.json and include the following content in it:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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