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.
This is based on the answer from vikas027 on Centos 7 and Docker 1.12
Since I am behind a proxy my full solution was ...
/etc/systemd/system/docker.service.d/http-proxy.conf
/usr/lib/systemd/system/docker.service
and dont forget to restart :)
Docker 1.12.1
For CentOS 7.2
For ubuntu 16.04
It seems the --insecure-registry option may be used both with and without the "=" between it and the registry ID.
Ubuntu 16.04
Create (does not exist) file
/etc/systemd/system/docker.service.d/registry.conf
with contents:then
I found the following to be very useful as it discusses how the Docker service itself is configured. https://docs.docker.com/articles/systemd/
Along with this article on the systemctl command https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
I used the following series of commands in a Centos 7 based container with a registry image obtained by "docker pull registry:2.1.1"
And inside the override.conf added the following.
Note the first, blank, ExecStart= clears anything that is already in place so be sure to add anything from the /usr/lib/systemd/system/docker.service ExecStart= statement that you wish to retain.
If you don't specify the -d(daemon) option you'll get a "Please specify only one -H" error.
After issuing the following series of commands I can see my overrides in place.
NOTE: The information provided by Loaded: and Drop-In: lines in the status message, the are useful for checking what's happening with a pre-existing docker daemon to work.
NOTE: Also have a look in the Loaded: docker.service file for an EnvironmentFile= for further clues.
I found that docker client version and registry docker version has to match up, else you would run into connectivity issues, despite having everything in place.
The following has been tested with:
I tried all of above mentioned answers, but none of these worked for me.
I was following these instructions in order to make it work
and
and other issues occurred that were solved as follows:
Issue 1
solution
host mapping in /etc/hosts:
Issue 2
solution
rerun the openssl command
press enter at every step except at:
and type the fqdn of the registry, i.e.
somehost
logging in to the registry succeeds now
Issue 3
Error response from daemon: Get https://somehost:8001/v1/users/: x509: certificate signed by unknown authority
solution