Skip to content

Write permission required on /etc/nginx #43

Closed
@eerotki

Description

@eerotki

I'm using nginxinc/nginx-unprivileged:alpine in Docker to run Nginx non-root. During the build in Dockerfile, I restrict /etc/nginx folder to read & execute permissions only with chmod 555 -R /etc/nginx, so that no running config could be altered. Due to changes after 1.17.10 I'm experiencing unexpected behavior, where the build fails on start up with message:

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: Can not modify /etc/nginx/conf.d/default.conf (read-only file system?), exiting
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-configure-nginx-unprivileged.sh
sed: can't create temp file '/etc/nginx/conf.d/default.confXXXXXX': Permission denied

If I grant write permissions on /etc/nginx/conf.d the build will fail with message:

sed: can't create temp file '/etc/nginx/nginx.confXXXXXX': Permission denied

So I assume Nginx now requires write permissions on /etc/nginx. Is this behaviour intentional and expected?

I would like to retain my setup and deny write permissions on config folders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions