简体   繁体   中英

Not able to push image to private docker registry

After setting up a private docker registry on a server within my network, I'm not able to push images to it. Setup was done as following:

  1. setup a private docker registry according to docker documentation
  2. got a ssl certificate by the hosting-provider for the desired domain
  3. created a directory /certs on the registry server (192.xxx) and placed .cert and .key files there
  4. added domain to my local machine's host file 192.xxx example.com
  5. able to ping the server using the domain
  6. tagged an image as example.com/my-image and tried to push

But I'm always getting the error Get https://example.com/v2/ Bad Gateway

What am I doing wrong?

I think you need to authenticate to the repository you are trying to push the image to. Docker Command: docker login <address_to_your_repository> . It should prompt you for credentials.

The docker documentation shows that docker registry is started on port 5000, while your tag/push seems to not take that into account.

I would try to 2 things:

  • check from the client that you can access the port of the server on which you started the registry. A command like "curl example.com:5000" should not say connection refused
  • include the port in the tag, meaning use "example.com:5000/my-image" if you used port 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