Stop trying to use https to fetch the docker socket

Hi. :}

I'm currently trying to use traefik (2.1) to replace our nginx reverse proxy on our docker setup, in order to be more flexible on its config (adding the ability to switch services on the go, switch the ports, ... and so on).

After following a few tutorials here and there, I'm kinda stuck : wehn booting the reverse-proxy service (through docker-compose up -d reverse-proxy ...), on the logs, it states it can't have a proper http response on https://%2Fvar%2Frun%2Fdocker.sock/v1.24/version... instead of using a unix socket (unix:///var/run/docker.sock).

Here is a gist showing what I am trying to do : https://gist.github.com/Taluu/a49c0fa367cf6f7bc5986f0d738e55db

It seems it doesn't see the right endpoint or something like that ? If anyone would have an idea on how to solve that (or at least hints), I'd be grateful for that. :}

Thanks !

After some more investigation, it seems that by removing the tls config from the docker provider does the trick (I guess it still does a http call instead ?)

Not sure if it's great, so if anyone could explain that, it would be awesome. :}

4 years late, but I figured this out!

Somewhat confusingly the tls section under the traefik & docker documentation page Traefik Docker Documentation - Traefik

is about using tls when traefik talks to docker so it can read dynamic config from container labels, NOT about setting TLS certs for http routers.

If you're trying to setup tls certs for https connections you need to write a dynamic config file (see Traefik TLS Documentation - Traefik) and mount that in the correct directory so it gets loaded.

A great example of this here Advanced Traefik configuration tutorial - TLS, dashboard, ping, metrics, authentication and more - DEV Community