Docker push to private registry issues
Here is what I have setup:
Docker daemon running as insecure registry as below:
docker -d --iptables=true --insecure-registry 188.8.131.52:5000
Now, when I try to push to that registry from a remote system it is giving me different errors.
docker push 184.108.40.206:5000/test EOF error: FATA Error: Invalid registry endpoint 220.127.116.11:5000/v1: Get 18.104.22.168:5000/v1/_ping: EOF
Error 2: After getting error 2, I added the ip to the /etc/hosts on the docker host. If I try “docker push docker:5000/test” it tries to use https and fails with Error 1 and if I try “docker push docker/test”, it is asking me for a username and password. Is this expected ??
Error: The push refers to a repository [docker/test] (len: 1) Sending image list Please login prior to push: Username: docker Password: Email: firstname.lastname@example.org FATA Error response from daemon: Registration: "Forbidden username"
If it needs authentication, where can I find my username and password. Also can I start the docker registry without authentication ??
2 Solutions collect form web for “Docker push to private registry issues”
Once you have your private registry running you need to retag the image you want to upload. Assuming the command docker images returns a image called jason/test you use the docker tag command to copy it with a new name:
docker tag jason/test <server.name>:<port>/<image name>
Assuming that your internal docker registry is accessible via the dns name myregistry.mycompany.local and it running on the default port of 5000 the command would look like:
docker tag jason/test myregistry.mycompany.local:5000/test
The docker images command will now show:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE myregistry.mycompany.local:5000/test latest c776f089e3cf 6 days ago 707.3 MB jason/test latest c776f089e3cf 6 days ago 707.3 MB
Now you can run docker push myregistry.mycompany.local:5000/test to push the image to your internal registry.
Running the Docker daemon with the argument
--insecure-registry does not start an insecure registry, it just allows it to connect to one.
docker push 22.214.171.124:5000/test was trying to connect to a registry at
126.96.36.199:5000, but it doesn’t exist, so it errors out.
docker push docker/test tries to push to the official Docker Hub, which requires you to have set up an account, hence asking you for a username and password.
Have a look at the Github repository for the registry for details on how to run your own registry.