Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update modules Dockerfiles #742

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions modules/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ FROM ${NGINX_FROM_IMAGE} as builder

ARG ENABLED_MODULES

RUN set -ex \
&& if [ "$ENABLED_MODULES" = "" ]; then \
SHELL ["/bin/bash", "-exo", "pipefail", "-c"]
netsandbox marked this conversation as resolved.
Show resolved Hide resolved

RUN if [ "$ENABLED_MODULES" = "" ]; then \
echo "No additional modules enabled, exiting"; \
exit 1; \
fi

COPY ./ /modules/

RUN set -ex \
&& apt update \
&& apt install -y --no-install-suggests --no-install-recommends \
RUN apt-get update \
&& apt-get install -y --no-install-suggests --no-install-recommends \
patch make wget mercurial devscripts debhelper dpkg-dev \
quilt lsb-release build-essential libxml2-utils xsltproc \
equivs git g++ libparse-recdescent-perl \
Expand Down Expand Up @@ -42,7 +42,7 @@ RUN set -ex \
# some modules require build dependencies
if [ -f /modules/$module/build-deps ]; then \
echo "Installing $module build dependencies"; \
apt update && apt install -y --no-install-suggests --no-install-recommends $(cat /modules/$module/build-deps | xargs); \
apt-get update && apt-get install -y --no-install-suggests --no-install-recommends $(cat /modules/$module/build-deps | xargs); \
fi; \
# if a module has a build dependency that is not in a distro, provide a
# shell script to fetch/build/install those
Expand Down Expand Up @@ -71,10 +71,9 @@ RUN set -ex \

FROM ${NGINX_FROM_IMAGE}
RUN --mount=type=bind,target=/tmp/packages/,source=/tmp/packages/,from=builder \
set -ex \
&& apt update \
apt-get update \
&& . /tmp/packages/modules.env \
&& for module in $BUILT_MODULES; do \
apt install --no-install-suggests --no-install-recommends -y /tmp/packages/nginx-module-${module}_${NGINX_VERSION}*.deb; \
apt-get install --no-install-suggests --no-install-recommends -y /tmp/packages/nginx-module-${module}_${NGINX_VERSION}*.deb; \
done \
&& rm -rf /var/lib/apt/lists/
11 changes: 5 additions & 6 deletions modules/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ FROM ${NGINX_FROM_IMAGE} as builder

ARG ENABLED_MODULES

RUN set -ex \
&& if [ "$ENABLED_MODULES" = "" ]; then \
SHELL ["/bin/ash", "-exo", "pipefail", "-c"]

RUN if [ "$ENABLED_MODULES" = "" ]; then \
echo "No additional modules enabled, exiting"; \
exit 1; \
fi

COPY ./ /modules/

RUN set -ex \
&& apk update \
RUN apk update \
&& apk add linux-headers openssl-dev pcre2-dev zlib-dev openssl abuild \
musl-dev libxslt libxml2-utils make mercurial gcc unzip git \
xz g++ coreutils \
Expand Down Expand Up @@ -63,8 +63,7 @@ RUN set -ex \

FROM ${NGINX_FROM_IMAGE}
RUN --mount=type=bind,target=/tmp/packages/,source=/tmp/packages/,from=builder \
set -ex \
&& . /tmp/packages/modules.env \
. /tmp/packages/modules.env \
&& for module in $BUILT_MODULES; do \
apk add --no-cache --allow-untrusted /tmp/packages/nginx-module-${module}-${NGINX_VERSION}*.apk; \
done
Loading