From 30c363c6b7dbde0400e80d88bbf8bc7c3ba89218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Bjug=C3=A5rd?= <287697+abjugard@users.noreply.github.com> Date: Tue, 7 Feb 2023 09:04:11 +0100 Subject: [PATCH] Use XCADDY_SETCAP environment variable to set cap_net_bind_service on output caddy binary when building --- 2.6/builder/Dockerfile | 2 ++ Dockerfile.builder.tmpl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/2.6/builder/Dockerfile b/2.6/builder/Dockerfile index 866ce34..d213c85 100644 --- a/2.6/builder/Dockerfile +++ b/2.6/builder/Dockerfile @@ -10,6 +10,8 @@ ENV XCADDY_VERSION v0.3.2 ENV CADDY_VERSION v2.6.2 # Configures xcaddy to not clean up post-build (unnecessary in a container) ENV XCADDY_SKIP_CLEANUP 1 +# Sets capabilities for output caddy binary to be able to bind to privileged ports +ENV XCADDY_SETCAP 1 RUN set -eux; \ apkArch="$(apk --print-arch)"; \ diff --git a/Dockerfile.builder.tmpl b/Dockerfile.builder.tmpl index 3a0c1e1..c403252 100644 --- a/Dockerfile.builder.tmpl +++ b/Dockerfile.builder.tmpl @@ -10,6 +10,8 @@ ENV XCADDY_VERSION v{{ .xcaddy_config.version }} ENV CADDY_VERSION v{{ .config.caddy_version }} # Configures xcaddy to not clean up post-build (unnecessary in a container) ENV XCADDY_SKIP_CLEANUP 1 +# Sets capabilities for output caddy binary to be able to bind to privileged ports +ENV XCADDY_SETCAP 1 RUN set -eux; \ apkArch="$(apk --print-arch)"; \