I'm trying to setup a private docker registry using the image taken from: https://github.com/docker/docker-registry
Just by running:
docker run -p 5000:5000 registry
I can pull/push from/to this repository only from localhost, but if i try to access it from another machine (using a private address on the same LAN) it fails with an error message:
*2014/11/03 09:49:04 Error: Invalid registry endpoint https ://10.0.0.26:5000/v1/':
Get https:// 10.0.0.26:5000/v1/_ping: Forbidden. If this private
registry supports only HTTP or HTTPS with an unknown CA certificate,
please add `--insecure-registry 10.0.0.26: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/10.0.0.26:5000/ca.crt*
What drives me crazy is that I can access it successfully using:
curl 10.0.0.26:5000
and/or curl 10.0.0.26:5000/v1/search
I also don't understand where and how I should pass the --insecure-registry
flag.
Edit the config file "/etc/default/docker"
add the line at the end of file
(replace the 192.168.2.170 with your own ip address)
and restart docker service
Two step solution(without
--insecure-registry
):/etc/docker/certs.d/$HOSTNAME/
directoryNow your docker will trust your self-signed certificate.
To save you hassle, why don't you just use the FREE private docker registry service provided by gitlab - works great
https://about.gitlab.com/2016/05/23/gitlab-container-registry/
Their registry is secure so you won't have any issues
use the following command replacing {YOUR_REGISTRY} with your registry