Skip to content

Commit bea4974

Browse files
author
Simeon Castle
authored
Update Dockerfile.unprivileged
1 parent c6f1f19 commit bea4974

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dockerfile.unprivileged

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
# to allow running NGINX S3 Gateway as a non root user.
44
# Steps are based on the official unprivileged container:
55
# https://github.com/nginxinc/docker-nginx-unprivileged/blob/main/Dockerfile-debian.template
6-
FROM nginx-s3-gateway
6+
FROM docker.io/nginxinc/nginx-s3-gateway:latest
77

88
# Implement changes required to run NGINX as an unprivileged user
99
RUN sed -i "/^server {/a \ listen 8080;" /etc/nginx/templates/default.conf.template \
1010
&& sed -i '/user nginx;/d' /etc/nginx/nginx.conf \
1111
&& sed -i 's#http://127.0.0.1:80#http://127.0.0.1:8080#g' /etc/nginx/include/s3gateway.js \
12+
&& sed -i 's#80#8080#g' /etc/nginx/conf.d/default.conf \
13+
&& sed -i 's#80#8080#g' /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh \
1214
&& sed -i 's,/var/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf \
1315
&& 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 \
1416
# Nginx user must own the cache and etc directory to write cache and tweak the nginx config

0 commit comments

Comments
 (0)