Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

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

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN set -ex; \
tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
rm -f /tmp/traefik.tar.gz; \
chmod +x /usr/local/bin/traefik
RUN [ ! -e /etc/nsswitch.conf ] && echo "hosts: files dns" > /etc/nsswitch.conf
COPY entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
1 change: 1 addition & 0 deletions alpine/tmplv1.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN set -ex; \
esac; \
wget --quiet -O /usr/local/bin/traefik "https://github.com/containous/traefik/releases/download/$VERSION/traefik_linux-$arch"; \
chmod +x /usr/local/bin/traefik
RUN [ ! -e /etc/nsswitch.conf ] && echo "hosts: files dns" > /etc/nsswitch.conf
COPY entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
1 change: 1 addition & 0 deletions alpine/tmplv2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN set -ex; \
tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
rm -f /tmp/traefik.tar.gz; \
chmod +x /usr/local/bin/traefik
RUN [ ! -e /etc/nsswitch.conf ] && echo "hosts: files dns" > /etc/nsswitch.conf
COPY entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
7 changes: 4 additions & 3 deletions scratch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM scratch
COPY --from=traefik:v2.1.1-alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=traefik:v2.1.1-alpine /usr/share/zoneinfo /usr/share/
COPY --from=traefik:v2.1.1-alpine /usr/local/bin/traefik /
COPY --from=traefik:v2.1.0-alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=traefik:v2.1.0-alpine /usr/share/zoneinfo /usr/share/
COPY --from=traefik:v2.1.0-alpine /usr/local/bin/traefik /
COPY --from=traefik:v2.1.0-alpine /etc/nsswitch.conf /etc/nsswitch.conf

EXPOSE 80
VOLUME ["/tmp"]
Expand Down
1 change: 1 addition & 0 deletions scratch/tmplv1.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM scratch
COPY --from=traefik:${VERSION}-alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=traefik:${VERSION}-alpine /usr/share/zoneinfo /usr/share/
COPY --from=traefik:${VERSION}-alpine /usr/local/bin/traefik /
COPY --from=traefik:${VERSION}-alpine /etc/nsswitch.conf /etc/nsswitch.conf

EXPOSE 80
VOLUME ["/tmp"]
Expand Down
1 change: 1 addition & 0 deletions scratch/tmplv2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM scratch
COPY --from=traefik:${VERSION}-alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=traefik:${VERSION}-alpine /usr/share/zoneinfo /usr/share/
COPY --from=traefik:${VERSION}-alpine /usr/local/bin/traefik /
COPY --from=traefik:${VERSION}-alpine /etc/nsswitch.conf /etc/nsswitch.conf

EXPOSE 80
VOLUME ["/tmp"]
Expand Down