Set UID/GID for the php-fpm container: to fix file permissions on the host #4
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: autonomic-cooperative/wordpress-bedrock-template#4
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently:
We should be able to set the user and the group id that docker uses for the php-fpm container -- if we set these to the same user that's running docker-compose, then the file permissions should Just Work™.
https://newbedev.com/export-current-user-id-in-makefile-for-docker-compose
https://jtreminio.com/blog/running-docker-containers-as-current-host-user/
https://stackoverflow.com/a/66112924/14269772
Adding
user: 1000:1000
to the php-fpm container "sort of works".Two issues:
docker-compose
, that's one of the things that has pushed other projects to using a Makefile/etc/passwd
doesn't contain an entry for UID 1000, so SSH (including git-over-ssh) doesn't work because it requires a properly-created home directory.Solving #2 worsens #1 because the UID 1000 assumption is even more hard-coded if we create the user at image build time.
Solving #1 worsens 2 because it's even harder to add a user dynamically with an arbitrary UID (especially.. what if clashes?)
I am currently polling Autonomicans to find out how many people are using a non-1000 UID to see if we can maybe just continue with that default and improve it.