From 2f5696414e0748669edde98b6f72682cc2502299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Schneider?= <js@joergschneider.com> Date: Sun, 23 Aug 2020 09:04:19 +0200 Subject: [PATCH] Allow JEKYLL_UID/JEKYLL_GID with existing IDs Some standard UIDs/GIDs already exist in the docker image, e.g. nobody, nogroup, users. If JEKYLL_UID/JEKYLL_GID is used with a numeric ID matching one of those, then entrypoint aborts with an error like "groupmod: GID '33' already exists". This commit adds the -o option to usermod/groupmod to allow non-unique IDs. --- repos/jekyll/copy/all/usr/jekyll/bin/entrypoint | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint b/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint index 7834ddf..964180c 100755 --- a/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint +++ b/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint @@ -25,8 +25,8 @@ export JEKYLL_GID # behavior on OS X. # if [ "$JEKYLL_UID" != "0" ] && [ "$JEKYLL_UID" != "$(id -u jekyll)" ]; then - usermod -u "$JEKYLL_UID" jekyll - groupmod -g "$JEKYLL_GID" jekyll + usermod -o -u "$JEKYLL_UID" jekyll + groupmod -o -g "$JEKYLL_GID" jekyll chown_args="" [ "$FULL_CHOWN" ] && chown_args="-R" -- GitLab