We are extending the nginx:alpine image and attempting to run Nginx as the nginx user instead of the root user. However, we encounter a permission error when executing the entrypoint.
It appears that the home directory for the nginx user is set to /var/cache/nginx, but the nginx user lacks sufficient permissions to create folders within this directory.
To reproduce
Steps to reproduce the behavior:
Create a Dockerfile with the following content:
FROM nginx:1.27.1-alpine-slim
USER nginx
Build an image using the above Dockerfile.
Run a container from the created image
Observe the error.
Expected behavior
Since the home directory for the nginx user is /var/cache/nginx, the user should have the necessary permissions to create folders within this directory.
Your environment
Version/release of Docker and method of installation (e.g. Docker Desktop / Docker Server) - Docker version 26.1.4, build 5650f9b
Version/tag of the NGINX Docker image (e.g. nginx:alpine) - nginx:1.27.1-alpine-slim
Describe the bug
We are extending the nginx:alpine image and attempting to run Nginx as the
nginx
user instead of theroot
user. However, we encounter a permission error when executing the entrypoint.It appears that the home directory for the
nginx
user is set to/var/cache/nginx
, but thenginx
user lacks sufficient permissions to create folders within this directory.To reproduce
Steps to reproduce the behavior:
Expected behavior
Since the home directory for the
nginx
user is/var/cache/nginx
, the user should have the necessary permissions to create folders within this directory.Your environment
Docker version 26.1.4, build 5650f9b
nginx:alpine
) -nginx:1.27.1-alpine-slim
Additional context
Add any other context about the problem here.