Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx file permission problems (need to change uid/gid for www-data) #2799

Closed
szegheo opened this issue Dec 17, 2020 · 2 comments
Closed

Nginx file permission problems (need to change uid/gid for www-data) #2799

szegheo opened this issue Dec 17, 2020 · 2 comments

Comments

@szegheo
Copy link

szegheo commented Dec 17, 2020

Description:

Beacuse an issue with nginx:alpine a recent update in /nginx/Dockerfile made www-data user and group to id 82. This makes file permission conflicts between running containers, e.g. when same files needed to read/write both by Nginx (e.g. FastCGI caching) and php-fpm (to purge Nginx cache files).

Expected Behavior:

Nginx image should have the default ids (1000) for both user www-data and group www-data like other containers (php-fpm, workspace, etc...)

Context information:

1bfbe9a99ac66a06f6eea792b851eca54c74296b

Quickfix:

# Change 82 to 1000
RUN set -x ; \
    addgroup -g 1000 -S www-data ; \
    adduser -u 1000 -D -S -G www-data www-data && exit 0 ; exit 1

# Let usermod, groupmod available in alpine and change the ids
RUN apk add --no-cache shadow && usermod -u 1000 -o www-data && groupmod -g 1000 -o www-data

Looking at the console log while building, addgroup will be skipped, because www-data already exists (known issue) so we need to change its id with groupmod. However the user can be added. Running usermod wouldn't be necessary, because it was just created with id 1000, but it won't hurt... (just in case for further base image versions).

Best solution would be adding id ARGs for Nginx in /nginx/Dockerfile and in /env-example like php-fpm already has:

PHP_FPM_PUID=1000
PHP_FPM_PGID=1000
@stale
Copy link

stale bot commented Mar 19, 2021

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Mar 19, 2021
@stale
Copy link

stale bot commented Apr 10, 2021

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant