feat: manage long UID/GUID

This commit is contained in:
vincent 2022-12-04 09:43:07 +01:00
parent debe5bccbf
commit 86af71f43b
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
FROM alpine
FROM alpine:latest
RUN apk add --update-cache \
rsync \

View File

@ -11,7 +11,8 @@ echo "Preparation steps started."
if [ "$RSYNC_UID" != "" ] && [ "$RSYNC_GID" != "" ]; then
# UID and GID provided, create user
echo "UID and GID provided: $RSYNC_UID and $RSYNC_GID. Creating the user"
adduser -D -u $RSYNC_UID -g $RSYNC_GID rsyncuser
echo "rsyncuser:x:$RSYNC_UID:$RSYNC_GID::/home/rsyncuser:/bin/sh" >> /etc/passwd
echo "users:x:$RSYNC_GID:rsyncuser" >> /etc/group
RSYNC_USER=rsyncuser
else
# UID and GID not provided