Closed mprasil closed 4 years ago
Hi @mprasil , thanks for this proposal.
Could you update this PR to fit https://github.com/gliderlabs/docker-alpine/issues/367#issuecomment-424546457 (tianon being a maintainer/reviewer of the official Docker Library, his fix sounds like a solid pattern for the reviews)?
It means:
nsswitch.conf
files (and the related COPY
/ADD
instructions from the PRtmpl.Dockerfile
with the RUN
instruction for the nsswitch.Hi @dduportal, I've updated the PR and rebased on top of current master. Hopefully it's better now.
Resolved merge conflict.
This fixes an issue I've encountered - the absence of
/etc/nsswitch.conf
makes traefik ignore the/etc/hosts
file inside the container. For reference see here and here for alpine.This is very surprising and often painful in some scenarios like this one. But I suppose any user that is trying to use
--add-host
docker flag in lieu of DNS entry for whatever reason is going to be burned by that.The
nsswitch.conf
file added is default configuration found in most distributions I've seen. I've used it for completeness as that's the one distroless base image is using, but just having this one line in would alleviate the specific problem:I can modify the PR if you prefer that format.
Hope that helps.