Use explicit UID/GID and show them in error message

This commit is contained in:
rgaudin
2025-12-01 09:38:29 +00:00
parent 0232f0a95f
commit 81d9a6cc02
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ VOLUME /data
WORKDIR /data
# running as a named unprivileged user
RUN addgroup -S user && adduser -S user -G user
RUN addgroup -S -g 1001 user && adduser -S -u 1001 user -G user
RUN chown user:user /data
USER user

View File

@@ -6,7 +6,7 @@ then
# Check if /data is writable
if [ ! -w /data ]
then
echo "Data directory (mounted) at '/data' is not writable for container user 'user:user', ZIM file can not be written."
echo "'/data' directory is not writable by '$(id -n -u):$(id -n -g)' ($(id -u):$(id -g)). ZIM file(s) can not be written."
exit 1
fi