File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 22
33set -e
44
5- # Get UID/GID from volume dir
6- VOLUME_UID=$( stat -c ' %u' $VOLUME_DIR )
7- VOLUME_GID=$( stat -c ' %g' $VOLUME_DIR )
8-
9- MY_UID=$( id -u)
10- MY_GID=$( id -g)
11-
125# Run as custom user
13- if [ " $MY_GID " != " $VOLUME_GID " ] || [ " $MY_UID " != " $VOLUME_UID " ]; then
6+ if ! [ -w $VOLUME_DIR ]; then
7+ # Get UID/GID from volume dir
8+ VOLUME_UID=$( stat -c ' %u' $VOLUME_DIR )
9+ VOLUME_GID=$( stat -c ' %g' $VOLUME_DIR )
10+
1411 # create or modify user and group to match expected uid/gid
1512 groupadd --gid $VOLUME_GID archivist || groupmod -o --gid $VOLUME_GID archivist
1613 useradd -ms /bin/bash -u $VOLUME_UID -g $VOLUME_GID archivist || usermod -o -u $VOLUME_UID archivist
3633 # run process directly
3734 exec $@
3835fi
39-
You can’t perform that action at this time.
0 commit comments