Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - Unable to push image to private registry

I have created my own private registry on my server by pulling and running the registry image.

sudo docker run -d -p 5000:5000 registry

After which, I tried to tag a simple image and push it to the server.

sudo docker tag ubuntu:latest localhost:5000/myprivateubuntu

And I received this error:

Error: Invalid registry endpoint ... Get ... If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add '--insecure-registry localhost: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/localhost:5000/ca.crt

Anyhow know what's the problem?

like image 375
Hans Avatar asked Nov 14 '14 09:11

Hans


People also ask

Can Docker images be private?

Private repositories let you keep container images private, either to your own account or within an organization or team. You get one private repository for free with your Docker Hub user account (not usable for organizations you're a member of).


1 Answers

stop the service.

sudo service docker stop

restart service with --insecure-registry arguments:

/usr/bin/docker -d --insecure-registry localhost:5000

or edit /etc/default/docker file and add the following line:

DOCKER_OPTS="--insecure-registry localhost:5000"
like image 120
cizixs Avatar answered Oct 04 '22 09:10

cizixs