diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 0bf9a0304..48c57a74e 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -31,8 +31,6 @@ LABEL org.opencontainers.image.revision="${COMMIT_SHA}" LABEL build_id="${BUILD_ID}" -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/modules_mount/etc/nginx/modules/modules - WORKDIR /etc/nginx RUN apk update \ @@ -61,7 +59,12 @@ RUN bash -xeu -c ' \ for dir in "${writeDirs[@]}"; do \ mkdir -p ${dir}; \ chown -R www-data.www-data ${dir}; \ - done' + done' \ + # LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules + # Put libs of newer modules under `/modules_mount//lib` and add that path below + # Could get complicated arch specific paths become a need + && echo "/lib:/usr/lib:/usr/local/lib:/modules_mount/otel/lib" > /etc/ld-musl-x86_64.path + RUN apk add --no-cache libcap \ && setcap cap_net_bind_service=+ep /nginx-ingress-controller \ diff --git a/rootfs/Dockerfile.chroot b/rootfs/Dockerfile.chroot index 04adccf8a..10a335679 100644 --- a/rootfs/Dockerfile.chroot +++ b/rootfs/Dockerfile.chroot @@ -44,7 +44,6 @@ LABEL build_id="${BUILD_ID}" ENV LUA_PATH="/usr/local/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/lib/lua/?.lua;;" ENV LUA_CPATH="/usr/local/lib/lua/?/?.so;/usr/local/lib/lua/?.so;;" ENV PATH=$PATH:/usr/local/luajit/bin:/usr/local/nginx/sbin:/usr/local/nginx/bin -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/modules_mount/etc/nginx/modules/modules RUN apk update \ && apk upgrade \ @@ -81,7 +80,11 @@ RUN bash -xeu -c ' \ for dir in "${writeDirs[@]}"; do \ mkdir -p ${dir}; \ chown -R www-data.www-data ${dir}; \ - done' + done' \ + # LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules + # Put libs of newer modules under `/modules_mount//lib` and add that path below + # Could get complicated arch specific paths become a need + && echo "/lib:/usr/lib:/usr/local/lib:/modules_mount/otel/lib" > /etc/ld-musl-x86_64.path RUN apk add --no-cache libcap \ && setcap cap_sys_chroot,cap_net_bind_service=+ep /nginx-ingress-controller \