From c01408981a8e826b895dec9438d232522b26b4d9 Mon Sep 17 00:00:00 2001 From: Martin Chaine Date: Sun, 1 Jun 2025 22:27:34 +0200 Subject: [PATCH] fix(docker): install envsubst from source to support more targets --- docker/php/Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index c357c3913..3aef31c2b 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,3 +1,12 @@ +FROM golang as envsubst + +ARG ENVSUBST_VERSION=v1.3.0 + +# envsubst from gettext can not replace env vars with default values +# this package is not available for ARM32 and we have to build it from source code +# flag -ldflags "-s -w" produces a smaller executable +RUN go install -ldflags "-s -w" -v github.com/a8m/envsubst/cmd/envsubst@${ENVSUBST_VERSION} + FROM php:8.2-fpm AS rootless ARG DEBIAN_FRONTEND=noninteractive @@ -75,10 +84,8 @@ RUN mkdir -p /tmp/blackfire \ RUN npm install -g yarn -RUN curl -L -o /usr/local/bin/envsubst https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m`; \ - chmod +x /usr/local/bin/envsubst - COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=envsubst /go/bin/envsubst /usr/local/bin/envsubst COPY entrypoint.sh /entrypoint.sh COPY config/ /opt/wallabag/config/