Add Insecure Registry to Docker

+1 vote

I have a docker 1.12 running on CentOS. I am trying to add insecure registry to it. The system uses systemd so I created a /etc/systemd/system/docker.service.d/50-insecure-registry.conf file.

$ cat /etc/systemd/system/docker.service.d/50-insecure-registry.conf

After loading daemon and restarting docker service, systemd shows that the environment variable is there

$ sudo systemctl show docker | grep Env

But when I run docker info I don't see that insecure registry added

$ docker info
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:

Pushing images to fails with

Pushing application     (
The push refers to a repository     []
ERROR: Get http: server gave HTTP response to HTTPS client

Is there something that could be done ? Am I missing something ?

Aug 1, 2018 in Docker by Hannah
• 18,570 points

2 answers to this question.

0 votes

To add an insecure docker registry, add the file /etc/docker/daemon.json with the following content:

    "insecure-registries" : [ "" ]

and then restart docker.

answered Aug 1, 2018 by Kalgi
• 52,370 points
Thank you !!
it worked for me.
+1 vote

I added into /etc/default/docker file

DOCKER_OPTS="--insecure-registry <myip>:5000"

I edited that line with FQDN, IP address, --insecure-registry=<myip>:5000, and--insecure-registry http://<myip>:5000

answered Apr 26, 2019 by Hitesh

Related Questions In Docker

0 votes
1 answer

Docker: Add a restart policy to a container that was already created

In recent versions of docker (as of ...READ MORE

answered Jul 30, 2018 in Docker by Kalgi
• 52,370 points
0 votes
1 answer
0 votes
1 answer

How to push a docker image onto the Azure Container Registry (ACR)?

Before pushing local Docker image to ACR, ...READ MORE

answered Jul 4, 2019 in Docker by Sirajul
• 59,090 points
0 votes
1 answer

How to add one worker node to the Docker swarm?

Hi@akhtar, You will get one token when you ...READ MORE

answered Dec 24, 2020 in Docker by MD
• 95,300 points
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,140 points
0 votes
2 answers
+1 vote
2 answers