From 4928cdd69afa8b997ecc9f873ed670f4578cc3e8 Mon Sep 17 00:00:00 2001 From: KusakabeShi Date: Sun, 1 Jan 2023 10:10:40 +0800 Subject: [PATCH] Allow custom UID/GID --- entrypoint.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 956903b..a8816a5 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,6 +11,14 @@ if ! sleep 0 >/dev/null 2>&1; then >&2 echo "WARNING: clock_nanosleep or clock_nanosleep_time64 is not available on the system" fi +export ATLAS_UID="${ATLAS_UID:-101}" +export ATLAS_GID="${ATLAS_GID:-999}" + +usermod -u $ATLAS_UID atlas +groupmod -g $ATLAS_GID atlas +chown -R atlas:atlas /var/atlas-probe +chown -R atlas:atlas /var/atlasdata + # create essential files and fix permission mkdir -p /var/atlas-probe/status chown -R atlas:atlas /var/atlas-probe/status