Skip to content

Commit

Permalink
Install libcap and run setcap cap_net_bind_service=+eip on caddy bi…
Browse files Browse the repository at this point in the history
…nary

Mitigates caddyserver#104
  • Loading branch information
abjugard committed Jan 17, 2023
1 parent ffa8b84 commit e357905
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion 2.6/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.16

RUN apk add --no-cache ca-certificates mailcap
RUN apk add --no-cache ca-certificates mailcap libcap

RUN set -eux; \
mkdir -p \
Expand Down Expand Up @@ -30,6 +30,7 @@ RUN set -eux; \
echo "$checksum /tmp/caddy.tar.gz" | sha512sum -c; \
tar x -z -f /tmp/caddy.tar.gz -C /usr/bin caddy; \
rm -f /tmp/caddy.tar.gz; \
setcap cap_net_bind_service=+eip /usr/bin/caddy; \
chmod +x /usr/bin/caddy; \
caddy version

Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ .base | strings.TrimSpace }}

RUN apk add --no-cache ca-certificates mailcap
RUN apk add --no-cache ca-certificates mailcap libcap

RUN set -eux; \
mkdir -p \
Expand Down Expand Up @@ -30,6 +30,7 @@ RUN set -eux; \
echo "$checksum /tmp/caddy.tar.gz" | sha512sum -c; \
tar x -z -f /tmp/caddy.tar.gz -C /usr/bin caddy; \
rm -f /tmp/caddy.tar.gz; \
setcap cap_net_bind_service=+eip /usr/bin/caddy; \
chmod +x /usr/bin/caddy; \
caddy version

Expand All @@ -53,4 +54,4 @@ EXPOSE 2019

WORKDIR /srv

CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

0 comments on commit e357905

Please sign in to comment.