In developing and deploying Docker applications it is sometimes necessary to push and pull images to/from a HTTP Docker registry. This is considered very insecure and HTTPS is preferred, but when you don’t control the registry yourself you may need to resort to this option. This guide describes how to push/pull images to/from a plain HTTP Docker registry from Red Hat Enterprise Linux 7.2, where the exact steps are non-obvious.
The official Docker documentation says to add the --insecure-registry flag to your docker engine’s configuration file and restart the daemon but doesn’t give the precise commands for RHEL7, so here they are.
# edit the docker configuration file (as root) $ sudo vim /usr/lib/systemd/system/docker.service # append the --insecure-registry flag to the ExecStart command ExecStart=/usr/bin/dockerd --insecure-registry <registry>:<port> # restart the docker daemon $ sudo service docker restart
That’s it. Now go secure that Docker registry!