File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ COPY dotnet-apphost-pack-9.0-9.0.11-1.x86_64.rpm /tmp/
7373COPY aspnetcore-targeting-pack-9.0-9.0.11-1.x86_64.rpm /tmp/
7474# !RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/a/aspnetcore-runtime-9.0-9.0.11-1.x86_64.rpm sha256:4cb45f53d40b656d07a92cada658c9e75eb79a9e3caa46eb2bad1d019153574d
7575COPY aspnetcore-runtime-9.0-9.0.11-1.x86_64.rpm /tmp/
76- # !RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-sdk-9.0-9.0.307 -1.x86_64.rpm sha256:894f36b0a6ae63f5cf4ae9003619ad3f211078231fc7846dcdb66a10f5d1aa47
77- COPY dotnet-sdk-9.0-9.0.307 -1.x86_64.rpm /tmp/
76+ # !RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-sdk-9.0-9.0.308 -1.x86_64.rpm sha256:87695d1e083a52cfd0488dd1f5381a7c5083ae3bcb0031ca1ac3ae9d70387475
77+ COPY dotnet-sdk-9.0-9.0.308 -1.x86_64.rpm /tmp/
7878
7979
8080# Workaround for https://github.com/openSUSE/obs-build/issues/487
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ COPY --from=target / /target
2727
2828RUN set -euo pipefail; \
2929 export CHKSTAT_ALLOW_INSECURE_MODE_IF_NO_PROC=1; \
30- zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends gawk nginx findutils gettext-runtime
30+ zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends gawk nginx findutils gettext-runtime sed grep
3131# sanity check that the version from the tag is equal to the version of nginx that we expect
3232RUN set -euo pipefail; \
3333 [ "$(rpm --root /target -q --qf '%{version}' nginx | \
@@ -76,5 +76,5 @@ COPY [1-3]0-*.sh /docker-entrypoint.d/
7676COPY docker-entrypoint.sh /usr/local/bin
7777COPY index.html /srv/www/htdocs/
7878RUN set -euo pipefail; chmod +x /docker-entrypoint.d/*.sh /usr/local/bin/docker-entrypoint.sh
79- RUN set -euo pipefail; install -d -o nginx -g nginx -m 750 /var/log/nginx; ln -sf /dev/stdout /var/log/nginx/access.log; ln -sf /dev/stderr /var/log/nginx/error.log
79+ RUN set -euo pipefail; install -d -o nginx -g nginx -m 750 /var/log/nginx; install -d /var/cache/nginx /var/run; ln -sf /dev/stdout /var/log/nginx/access.log; ln -sf /dev/stderr /var/log/nginx/error.log; chown -R nginx:nginx /var/cache/nginx; chown -R nginx:nginx /etc/nginx; chown -R nginx:nginx /var/run; install -d -o nginx -g nginx /tmp/client_temp /tmp/proxy_temp /tmp/fastcgi_temp /tmp/uwsgi_temp /tmp/scgi_temp; chown -R nginx:nginx /tmp; chmod -R g+w /var/cache/nginx /var/log/nginx /etc/nginx /var/run /tmp
8080STOPSIGNAL SIGQUIT
Original file line number Diff line number Diff line change @@ -44,4 +44,21 @@ if [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then
4444 fi
4545fi
4646
47+ CURRENT_UID=$( id -u)
48+ if [ " $CURRENT_UID " -gt " 0" ]; then
49+ # Running as Unprivileged User
50+ entrypoint_log " $0 : Running as unprivileged user (UID: $CURRENT_UID ). Configuring for unprivileged mode (Port 8080)."
51+
52+ # Remove the 'user' directive
53+ sed -i ' /^user/d' /etc/nginx/nginx.conf
54+ entrypoint_log " $0 : Removed 'user' directive for unprivileged worker."
55+
56+ # Ensure PID path is set to /tmp/nginx.pid
57+ sed -i ' s,^#\?\s*pid\s\+.*;$,pid /tmp/nginx.pid;,' /etc/nginx/nginx.conf
58+ sed -i " /^http {/a \ proxy_temp_path /tmp/proxy_temp;\n client_body_temp_path /tmp/client_temp;\n fastcgi_temp_path /tmp/fastcgi_temp;\n uwsgi_temp_path /tmp/uwsgi_temp;\n scgi_temp_path /tmp/scgi_temp;\n" /etc/nginx/nginx.conf
59+ sed -i ' s/listen \(.*\)80;/listen \18080;/' /etc/nginx/conf.d/default.conf 2> /dev/null || \
60+ sed -i ' s/listen \(.*\)80;/listen \18080;/' /etc/nginx/nginx.conf 2> /dev/null || true
61+ entrypoint_log " $0 : Listening on port 8080."
62+ fi
63+
4764exec " $@ "
You can’t perform that action at this time.
0 commit comments