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
{{ message }}
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
I'm having permissions issues every time files get created by the container and I need to chown the files to my host user to be able to edit them.
The container uses root (uid=0 gid=0) so when it creates files (using e.g: drush config:export or files created in sites/default/files and many other cases) I can't edit them on phpstorm running on my host machine with my current user "herve" (uid=1000 gid=1000).
I then need to sudo chown the files to my host user to be able to edit them - sudo chown herve:herve -R ...
If I'm not mistaken, this could be solved by creating a user in the container with matching uid and gid, and run shells as that user. Similar to how it's done in wodby/php.
Can you confirm you also have this behavior with file permissions? Or is it just me?
If so, is there perhaps already a consensus on having to chown every time files created by the container (which is a bit painful IMO) or is there something we can do to fix this?
Thank you,
Hervé
The text was updated successfully, but these errors were encountered:
For what it's worth, I created a user in a custom build context for now:
FROM fpfis/httpd-php-dev:7.2
# Create an "fpfis" user with given UID and GID (to use for bash and FPM).
# The UID and GID should match the ones from your host, running phpstorm.
ARG FPFIS_USER_ID=1000
ARG FPFIS_GROUP_ID=1000
RUN set -xe; \
\
# Delete existing user/group if uid/gid occupied.
existing_group=$(getent group "${FPFIS_GROUP_ID}" | cut -d: -f1); \
if [ -n "${existing_group}" ]; then delgroup "${existing_group}"; fi; \
existing_user=$(getent passwd "${FPFIS_USER_ID}" | cut -d: -f1); \
if [ -n "${existing_user}" ]; then deluser "${existing_user}"; fi; \
\
# Create or recreate the user and group.
addgroup --gid "${FPFIS_GROUP_ID}" fpfis; \
adduser --uid "${FPFIS_USER_ID}" --system --shell /bin/bash --group fpfis; \
adduser fpfis www-data; \
sed -i '/^fpfis/s/!/*/' /etc/shadow;
Hello,
I'm having permissions issues every time files get created by the container and I need to chown the files to my host user to be able to edit them.
The container uses root (uid=0 gid=0) so when it creates files (using e.g: drush config:export or files created in sites/default/files and many other cases) I can't edit them on phpstorm running on my host machine with my current user "herve" (uid=1000 gid=1000).
I then need to
sudo chown
the files to my host user to be able to edit them -sudo chown herve:herve -R ...
If I'm not mistaken, this could be solved by creating a user in the container with matching uid and gid, and run shells as that user. Similar to how it's done in wodby/php.
Can you confirm you also have this behavior with file permissions? Or is it just me?
If so, is there perhaps already a consensus on having to chown every time files created by the container (which is a bit painful IMO) or is there something we can do to fix this?
Thank you,
Hervé
The text was updated successfully, but these errors were encountered: