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:50
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.
This is what worked for me on CentOS 7.2 and Docker 1.12.1 (latest as on date). My private registry v2 was running on 192.168.1.88:5000
, change it accordingly. This also works if you have multiple registries, just keep on adding --insecure-registry IP:Port
$ sudo vim /usr/lib/systemd/system/docker.service
#ExecStart=/usr/bin/dockerd
ExecStart=/usr/bin/dockerd --insecure-registry 192.168.1.88:5000
$
$ sudo systemctl stop docker
$ sudo systemctl daemon-reload
$ systemctl start docker
Ubuntu 16.04
Create (does not exist) file /etc/systemd/system/docker.service.d/registry.conf
with contents:
[Service]
#You need the below or you 'ExecStart=' or you will get and error 'Service has more than one ExecStart= setting, which is only allowed'
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry 10.20.30.40:5000
then
sudo systemctl stop docker
sudo systemctl daemon-reload
sudo systemctl start docker