You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing anything with Composer, it shows this warning:
Cannot create cache directory /composer/cache/files/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only.
At some point, I even started experiencing errors when installing certain packages, so that was the moment I had enough of this and started investigating it.
The base image sets the user and group for /composer to www-data, as expected:
However, after using docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID, the ownership gets out of sync, and there are no checks to avoid this from happening.
Workaround/Fix:
Currently, the fix is running chown for that folder manually, e.g.
# Set the user ID and group ID for www-dataRUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx && \
chown -R $USER_ID:$GROUP_ID /composer
# ^^^ add this line
Possible solutions:
apply the same solution as the workaround, but put it into the template
update docker-php-serversideup-set-file-permissions to add a new service called composer, or add it as part of existing services, then update the container docs if needed, over at https://github.com/serversideup/docker-php
Bonus question, which should belong to the image repo: /var/cache/nginx seems to exist and is owned by www-data, but it's only chown'd in docker-php-serversideup-set-file-permissions for Debian, not others. I am not sure whether it is used or not on other ones, e.g. Alpine.
The text was updated successfully, but these errors were encountered:
jaydrogers
transferred this issue from serversideup/spin-template-laravel-basic
Dec 14, 2024
jaydrogers
changed the title
/composer directory does not have updated permissions
/composer directory does not have updated permissions after running "docker-php-serversideup-set-file-permissions"
Dec 14, 2024
When installing anything with Composer, it shows this warning:
At some point, I even started experiencing errors when installing certain packages, so that was the moment I had enough of this and started investigating it.
The base image sets the user and group for
/composer
to www-data, as expected:docker-php/src/variations/fpm-nginx/Dockerfile
Lines 140 to 142 in 4807f98
However, after using
docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID
, the ownership gets out of sync, and there are no checks to avoid this from happening.Workaround/Fix:
Currently, the fix is running
chown
for that folder manually, e.g.Possible solutions:
docker-php-serversideup-set-id
, over at https://github.com/serversideup/docker-phpdocker-php-serversideup-set-file-permissions
to add a new service calledcomposer
, or add it as part of existing services, then update the container docs if needed, over at https://github.com/serversideup/docker-phpBonus question, which should belong to the image repo:
/var/cache/nginx
seems to exist and is owned bywww-data
, but it's only chown'd indocker-php-serversideup-set-file-permissions
for Debian, not others. I am not sure whether it is used or not on other ones, e.g. Alpine.The text was updated successfully, but these errors were encountered: