Browse Source

Use PUID/PGID for chown statements (#3567)

When the passed PGID already exists in the base image, the groupadd is not executed hence a reference to appgroup in the chown statements fails
zan73 8 months ago
parent
commit
95705a2cf1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      docker-entrypoint.sh

+ 2 - 2
docker-entrypoint.sh

@@ -20,10 +20,10 @@ if ! getent passwd "$PUID" >/dev/null; then
   useradd --create-home --shell /bin/bash --uid "$PUID" --gid "$PGID" appuser
 fi
 # Make user the owner of the app directory.
-chown -R appuser:appgroup /app
+chown -R "$PUID":"$PGID" /app
 # Copy the default .bashrc file to the appuser home directory.
 cp /etc/skel/.bashrc /home/appuser/.bashrc
-chown appuser:appgroup /home/appuser/.bashrc
+chown "$PUID":"$PGID" /home/appuser/.bashrc
 export HOME=/home/appuser
 # Set permissions on font directories.
 if [ -d "/usr/share/fonts" ]; then