If you have installed a local docker registry without signed SSL certificates, the docker daemon will need to be started in a way to allow connection in insecure mode. For details see this note from Docker. In this guide I will show you how to configure VMware Photon OS to connect to a registry in insecure mode. Please note this is only advised for Development and testing environments. For added security you should always setup you clients and registry in secure mode.
Pre-Reqs
Open an SSH session and login to your Photon OS VM. We will configure Docker to allow connecting to an insecure registry since we used HTTP for our registry server and did not setup signed certs, use vi editor to create a file /etc/default/docker
vi /etc/default/docker
Click i and then enter the following to point to the host name or ip and port (if other than port 80) then click the esc key, then hold shift and pres ZZ to save the file
DOCKER_OPTS="--insecure-registry reg.corp.local"
Note: If you are using the registry from Docker it may be something like this:
DOCKER_OPTS="--insecure-registry registry.corp.local:5000"
Now start Docker with the following command
Note: If docker was already running just type systemctl restart docker
Now login to the registry with the following and use the user and password you setup in your registry
docker pull vmwarecna/nginx
docker tag vmwarecna/nginx reg.corp.local/library/myimage
docker push reg.corp.local/library/myimage
You are now setup to push and pull images to your local registry in insecure mode. Enjoy!
Hi Ryan,
I followed your guide but when I run the login command I get the following error :
“certificate signed by unknown authority”
Hi Tomer,
It may be something on the registry you are using, take a look at this guide https://docs.docker.com/registry/insecure/