Skip to content

Commit ff39bd8

Browse files
committed
Injecting ARM v7/v8 architecture for LibreSSL
1 parent 9611db8 commit ff39bd8

6 files changed

Lines changed: 66 additions & 18 deletions

File tree

mainline/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM alpine:latest
33
ENV NGINX_VERSION=1.31.2
44
ENV 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

6165
RUN 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 \
239250
COPY nginx.conf /etc/nginx/nginx.conf
240251
COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252

242-
ARG TARGETARCH=unknown
243-
ARG TARGETOS=unknown
244-
245253
LABEL 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" \

mainline/Dockerfile.loongarch64

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM --platform=linux/loong64 loongarch64/alpine:3.21
33
ENV NGINX_VERSION=1.31.2
44
ENV 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

6165
RUN 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 \
239250
COPY nginx.conf /etc/nginx/nginx.conf
240251
COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252

242-
ARG TARGETARCH=unknown
243-
ARG TARGETOS=unknown
244-
245253
LABEL 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" \

mainline/Dockerfile.mips64le

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM --platform=linux/mips64le alpine:3.14
33
ENV NGINX_VERSION=1.31.2
44
ENV 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

6165
RUN 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 \
239250
COPY nginx.conf /etc/nginx/nginx.conf
240251
COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252

242-
ARG TARGETARCH=unknown
243-
ARG TARGETOS=unknown
244-
245253
LABEL 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" \

stable/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM alpine:latest
33
ENV NGINX_VERSION=1.30.1
44
ENV 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

6165
RUN 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 \
239250
COPY nginx.conf /etc/nginx/nginx.conf
240251
COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252

242-
ARG TARGETARCH=unknown
243-
ARG TARGETOS=unknown
244-
245253
LABEL 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" \

stable/Dockerfile.loongarch64

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM --platform=linux/loong64 loongarch64/alpine:3.21
33
ENV NGINX_VERSION=1.30.1
44
ENV 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

6165
RUN 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 \
239250
COPY nginx.conf /etc/nginx/nginx.conf
240251
COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252

242-
ARG TARGETARCH=unknown
243-
ARG TARGETOS=unknown
244-
245253
LABEL 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" \

stable/Dockerfile.mips64le

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ FROM --platform=linux/mips64le alpine:3.14
33
ENV NGINX_VERSION=1.30.1
44
ENV 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

6165
RUN 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 \
239250
COPY nginx.conf /etc/nginx/nginx.conf
240251
COPY nginx.vh.no-default.conf /etc/nginx/conf.d/default.conf
241252

242-
ARG TARGETARCH=unknown
243-
ARG TARGETOS=unknown
244-
245253
LABEL 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

Comments
 (0)