If you are creating custom docker images for your enterprise, you have two choices on where to host your docker images:
- Docker Insecure Registry Command Line
- Docker Insecure Registry Tutorial
- Docker Insecure Registry Not Work
- Docker Insecure Registry Free
The proper way to set it is via the -engine-insecure-registry argument to docker-machine: You can also pass other options using -engine-opts. For example, set dns via -engine-opt dns=8.8.8.8. Mac docker's config file was in /.docker/daemon, The configuration you added to the software interface is the wrong configuration for the MAC. Apr 13, 2017 I added DOCKEROPTS='–insecure-registry 10.0.0.11:5000' to /etc/default/docker and restarted the docker service but didn’t help. Anyone an idea of what I am doing wrong? Kar1 (Kar1) April 13, 2017, 1:01pm. Insecure registry Pushing from Docker. Let’s assume the private insecure registry is at 10.141.241.175 on port 32000. The images we build need to be tagged with the. Warning: It’s not possible to use an insecure registry with basic authentication. This procedure configures Docker to entirely disregard security for your registry. This is very insecure and is not recommended. It exposes your registry to trivial man-in-the-middle (MITM) attacks. FAIL Error: did not detect an -insecure-registry argument on the Docker daemon Solution: Ensure that the Docker daemon is running with the following argument: -insecure-registry 172.30.0.0/16. I normally work on RedHat boxes, and this is usually easily solved by going to /etc/sysconfig/docker and adding the desired registry to the line: On.
- Docker Hub – This hosted registry service is free and provided by Docker Inc. They also have several enterprise level features where you can create multiple accounts for your organizations, setup automatic builds, etc.
- Self Hosted Docker Registry – You can setup docker registry within your organization that will host your own docker images.
This tutorial explains how to setup a a secure self-hosted docker registry.
1. Setup TLS Certificate and Key
Copy your existing crt and key file to ~/docker-certs directory
In this example, I’m using thegeekstuff.crt certificate file, and thegeekstuff.key file that was generated for my Apache webserver.

For details on how to create your own certificate and key file, refer to this: How To Generate SSL Key, CSR and Self Signed Certificate
2. Manage Intermediate Certificate file
In this case, I also had an Intermediate Certificate from my certificate authority.
For docker registry, you should combine both the certificate and the intermediate certificate into the same certificate file.
i.e Append the content of your intermediate certificate bundle to your certificate file as shown below.
3. Start Your Secure Docker Registry

Now, start your secure docker registry as shown below.
In the above command:
- Docker registry is getting started on port 5000
- The name of this docker container is “registry”
- The local directory which contains the certificate /root/docker-certs is mapped as /certs inside the docker registry container
- REGISTRY_HTTP_TLS_CERTIFICATE variable points to the certificate filename with full path
- REGISTRY_HTTP_TLS_KEY variable points to the key filename with full path
Once you start the docker registry, you’ll now see the registry container running as shown below:
4. Access your Secure Docker Registry
Docker Insecure Registry Command Line
Once the secure docker registry is setup, you can access it from other servers inside your network (or from outside your network), and use all the standard docker commands on it.
For example, you can push or pull an image to this secure docker registry as shown below.
5. Setup InSecure Docker Registry


Note: If you are having any trouble with the Secure Docker Registry, for debugging purpose, start your registry without the certificate and see how it works as shown below:
When you try to pull an image (or perform any other operation) from your docker registry, you might get the following “oversized record received with length” error message.
For example, when I executed the following command on a remote server (not on the server where the docker registry is setup), I get the following error message:
In this case, 192.168.101.1 is the server where the in-secure docker registry is running (i.e without the security certificates).
Docker Insecure Registry Tutorial
In this case, on the remote server, you should allow insecure registry operations. For this, you have to pass “–insecure-registry” parameter to the DOCKER_OPTS environment variable.
Docker Insecure Registry Not Work
On the remote server, modify this file and add the following line:
Now, restart the docker on the remote server.
Now, the docker pull (or any other docker command) will work without any issues, as the insecure registry option is setup.
The Docker service can use a JSON configuration file to change settings, including the list of insecure registries the engine will allow. Any registry domains in that list can use HTTP rather than HTTPS, so this is not something you should do for a registry hosted on a public network.
Docker Insecure Registry Free
Docker's configuration file is located at %programdata%dockerconfigdaemon.json (daemon is Linux terminology for a background service, so this is the name of the Docker service configuration file). You can manually edit it to add the local registry as a secure option and then restart the Docker Windows service. This configuration allows Docker to use the local registry with HTTP: