User docker constantly restarting when trying to use extra_args [Solved]

Hello,
I’m attempting to configure the user docker to use an insecure registry, I have the following in my cloud-config.yml

rancher:
  docker:
    args:
    - daemon
    - --insecure-registry
    - 192.168.0.4:5000

However I was getting the following error:

   http: server gave HTTP response to HTTPS client

I found this question on the forums:

However when I change args to extra_args and try restarting the docker daemon as the answer suggests, the daemon perpetually restarts itself. So its status is usually something like:

Restarting (1) Less than a second ago

You’re sending a HTTPS request to a port that is expecting HTTP. Insecure registry is still HTTPS (but without verifying the certificate) unless you explicitly say http://192.168.0.4:5000.

Hm, thanks for the idea, but no luck.

The way I’m reading the Docker docs, it seems like I should be able to use http. I assumed setting the args in cloud-config.yml would accomplish the same thing described here: https://docs.docker.com/registry/insecure/#/deploying-a-plain-http-registry
but when I run docker info I don’t see my registry listed under “Insecure Registries”, so it feels like rancher isn’t passing the args to docker.

Hello,

It’s ok for me with extra_args and 0.7.1 :

docker:
storage_driver: overlay
restart: true
tls: false
tls_args: [–tlsverify, --tlscacert=ca.pem, --tlscert=server-cert.pem, --tlskey=server-key.pem,‘-H=0.0.0.0:2376’]
extra_args:
- --insecure-registry
- 10.194.150.79:5000

Max

1 Like

Thanks Max!

Looking at your example, I noticed you were not providing the daemon arg. Removing that and using extra_args is now working as expected!