Skip to content

Commit

Permalink
Update base image and improve module build (#21)
Browse files Browse the repository at this point in the history
* Update base image to Alpine 3.20.0

* Update frozen requirements

* Add signature check to module build

* Add NGX_HTTP_HEADERS hack to fix module build
  • Loading branch information
mattclay committed Jun 18, 2024
1 parent 9918a75 commit 658879a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/bedrock/alpine:3.19.1 AS base
FROM quay.io/bedrock/alpine:3.20.0 AS base

RUN apk add \
nginx \
Expand Down
15 changes: 15 additions & 0 deletions build_spnego_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@ tar -xzC /usr/src -f "${SPNEGO_TAR}"

cd "${NGINX_SRC}"

# Hack to ensure the module compile options match the server.
export CFLAGS=-DNGX_HTTP_HEADERS=1

# shellcheck disable=SC2086
./configure ${NGINX_CONFIG} --add-dynamic-module="${SPNEGO_SRC}"

make modules

MODULE_SIGNATURE="$(strings "objs/${MODULE_NAME}" | grep -E '[01]{30,}')"
SERVER_SIGNATURE="$(strings /usr/sbin/nginx | grep -E '[01]{30,}')"

if [ "${MODULE_SIGNATURE}" != "${SERVER_SIGNATURE}" ]; then
echo "The configured module options do not match the server:"
echo "Module: ${MODULE_SIGNATURE}"
echo "Server: ${SERVER_SIGNATURE}"
echo "See https://github.com/nginx/nginx/blob/release-${NGINX_VERSION}/src/core/ngx_module.h to decode the signature."
echo "The mismatch could be due to configuration options or missing dependencies."
exit 1
fi

cp "objs/${MODULE_NAME}" "${MODULE_DIR}"

echo "load_module ${MODULE_DIR}/${MODULE_NAME};" > /usr/src/nginx.conf
Expand Down
4 changes: 2 additions & 2 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ click==8.1.7
decorator==5.1.1
flasgger==0.9.7.1
Flask==3.0.3
greenlet==2.0.2
greenlet==3.0.3
gunicorn==22.0.0
httpbin==0.10.2
itsdangerous==2.2.0
Expand All @@ -15,7 +15,7 @@ jsonschema==4.22.0
jsonschema-specifications==2023.12.1
MarkupSafe==2.1.5
mistune==3.0.2
packaging==24.0
packaging==24.1
pycparser==2.22
PyYAML==6.0.1
referencing==0.35.1
Expand Down

0 comments on commit 658879a

Please sign in to comment.