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

make alpine image to support setcap and run traefik to bind 80 with non root user #84

Open
wants to merge 3 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
6 changes: 4 additions & 2 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3.11
RUN apk --no-cache add ca-certificates tzdata
RUN apk --no-cache add ca-certificates tzdata libcap
RUN set -ex; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
Expand All @@ -11,7 +11,9 @@ RUN set -ex; \
wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v2.3.0-rc5/traefik_v2.3.0-rc5_linux_$arch.tar.gz"; \
tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
rm -f /tmp/traefik.tar.gz; \
chmod +x /usr/local/bin/traefik
chmod +x /usr/local/bin/traefik; \
setcap 'cap_net_bind_service=+ep' /usr/local/bin/traefik

COPY entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
6 changes: 4 additions & 2 deletions alpine/tmplv1.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:$ALPINE_VERSION
RUN apk --no-cache add ca-certificates tzdata
RUN apk --no-cache add ca-certificates tzdata libcap
RUN set -ex; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
Expand All @@ -9,7 +9,9 @@ RUN set -ex; \
*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
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
chmod +x /usr/local/bin/traefik; \
setcap 'cap_net_bind_service=+ep' /usr/local/bin/traefik

COPY entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
Expand Down
6 changes: 4 additions & 2 deletions alpine/tmplv2.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:$ALPINE_VERSION
RUN apk --no-cache add ca-certificates tzdata
RUN apk --no-cache add ca-certificates tzdata libcap
RUN set -ex; \
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
Expand All @@ -11,7 +11,9 @@ RUN set -ex; \
wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/${VERSION}/traefik_${VERSION}_linux_$arch.tar.gz"; \
tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
rm -f /tmp/traefik.tar.gz; \
chmod +x /usr/local/bin/traefik
chmod +x /usr/local/bin/traefik; \
setcap 'cap_net_bind_service=+ep' /usr/local/bin/traefik

COPY entrypoint.sh /
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
Expand Down