containous / traefik-library-image

ARCHIVED
https://github.com/traefik/traefik-library-image
Apache License 2.0
218 stars 60 forks source link

fix(dns): /etc/hosts was ignored by traefik #75

Open kopax opened 4 years ago

kopax commented 4 years ago

Fix https://github.com/containous/traefik/issues/6001

What does this PR do?

It create the missing /etc/nsswitch.conf.

Motivation

During proxying, traefik is performing a DNS resolution. This DNS resolution is skipping /etc/hosts file. This can cause unwanted DNS resolution, especially when using hostname as fqdn in marathon.

If you use /etc/hosts file for some resolution, this will fix it. If you use a real fqdn in marathon on a private network, you will still have to properly configure DNS serveur in traefik host.

ldez commented 4 years ago

Related to #42

kopax commented 4 years ago

I am curious, if this was already merged, why was it removed?

kopax commented 4 years ago

No clue why travis get this:

 ---> Running in d7c16a0f1158
OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
The command "./.ci/test.sh" exited with 1.
kopax commented 4 years ago

What command are required in the alpine image ? It seems they already have /etc/resolv.conf since you import them from another image.

kopax commented 4 years ago

Thanks for providing all the details, I've updated the PR with requested change.

dduportal commented 4 years ago

Side question: what is the status of this feature request for the Windows Docker images?

dduportal commented 4 years ago

Hi @kopax , can you ensure that you're setting the parent image to 2.1.1-alpine please? You can check the Travis-CI build logs, or run the command by yourself to reproduce the error on your local change.

kopax commented 3 years ago

Hi @dduportal too much time have passed since the https://github.com/containous/traefik/pull/6012 and I lost track of what is needed. What about the alpine image? Was this never fixed in recent traefik version? I am still running on 2.1.1 with this fix but perhaps it's time to close this?

dduportal commented 3 years ago

Hi @kopax , I am not involved anymore in the Traefik project. I would delegate to @ldez and @SantoDE to take care of your request instead :)