@@ -3,6 +3,10 @@ FROM --platform=linux/loong64 loongarch64/alpine:3.21
33ENV NGINX_VERSION=1.31.2
44ENV LIBRESSL_VERSION=4.3.2
55
6+ ARG TARGETARCH=unknown
7+ ARG TARGETVARIANT=
8+ ARG TARGETOS=unknown
9+
610# -----------------------------------------------------------------------------
711# Build flags -- kept as ENV so they are visible in `docker inspect`
812# -----------------------------------------------------------------------------
@@ -59,6 +63,11 @@ ENV CONFIG="\
5963"
6064
6165RUN set -eux \
66+ && LIBRESSL_HOST= \
67+ && case "${TARGETARCH:-}-${TARGETVARIANT:-}" in \
68+ arm-v6) LIBRESSL_HOST=armv6-alpine-linux-musleabihf ;; \
69+ arm-v7) LIBRESSL_HOST=armv7-alpine-linux-musleabihf ;; \
70+ esac \
6271 \
6372 # -- System user -----------------------------------------------------------
6473 && addgroup -S nginx \
@@ -164,6 +173,7 @@ RUN set -eux \
164173 \
165174 # -- Release build & install -----------------------------------------------
166175 && ./configure ${CONFIG} \
176+ ${LIBRESSL_HOST:+--with-openssl-opt="--host=$LIBRESSL_HOST"} \
167177 --with-cc-opt="-flto -fno-fat-lto-objects" \
168178 --with-ld-opt="-flto" \
169179 && make -j"$(getconf _NPROCESSORS_ONLN)" \
@@ -175,6 +185,7 @@ RUN set -eux \
175185 # ends up compiled without -g and -DNGINX_DEBUG flags.
176186 && make clean \
177187 && ./configure ${CONFIG} --with-debug \
188+ ${LIBRESSL_HOST:+--with-openssl-opt="--host=$LIBRESSL_HOST"} \
178189 --with-cc-opt="-flto -fno-fat-lto-objects" \
179190 --with-ld-opt="-flto" \
180191 && make -j"$(getconf _NPROCESSORS_ONLN)" \
@@ -239,9 +250,6 @@ RUN set -eux \
239250COPY nginx.conf /etc/nginx/nginx.conf
240251COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252
242- ARG TARGETARCH=unknown
243- ARG TARGETOS=unknown
244-
245253LABEL org.opencontainers.image.title="FreeNGINX with LibreSSL" \
246254 org.opencontainers.image.description="FreeNGINX ${NGINX_VERSION} built on Alpine with LibreSSL" \
247255 org.opencontainers.image.source="https://github.com/nginx-modules/docker-freenginx-libressl" \
0 commit comments