Skip to content

Commit 443ead3

Browse files
committed
Add IPv6 support to unprivileged Docker image
The unprivileged image needs to replace port 80 with port 8080 (since unprivileged users cannot bind to port 80). This fix modifies the sed commands to replace the port 80 listen directives (both IPv4 and IPv6) with port 8080 equivalents, ensuring dual-stack support without privilege issues. Fixes #339 Signed-off-by: Jesse Awan <jesse.awan@sap.com>
1 parent fb8d6e5 commit 443ead3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Dockerfile.unprivileged

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
FROM nginx-s3-gateway
77

88
# Implement changes required to run NGINX as an unprivileged user
9-
RUN sed -i "/^server {/a \ listen 8080;" /etc/nginx/templates/default.conf.template \
9+
RUN sed -i 's/listen[[:space:]]*80;/listen 8080;/g' /etc/nginx/templates/default.conf.template \
10+
&& sed -i 's/listen[[:space:]]*\[::\]:80;/listen [::]:8080;/g' /etc/nginx/templates/default.conf.template \
1011
&& sed -i '/user nginx;/d' /etc/nginx/nginx.conf \
1112
&& sed -i 's#http://127.0.0.1:80#http://127.0.0.1:8080#g' /etc/nginx/include/s3gateway.js \
1213
&& sed -i 's,/var/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf \

0 commit comments

Comments
 (0)