From be0aeb91d1367d10894290b68016097eaab83fea Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Mon, 19 Aug 2024 21:35:50 +0200 Subject: [PATCH] Testing permissions and uid/gid --- docker/Dockerfile | 4 ++-- docker/entrypoint.sh | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3449cfe..15f32e1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,8 +15,8 @@ ENV DOWNLOAD_VALIDATE_TOPICS "false" ENV DOWNLOAD_WORKERS 8 ENV LOG_PATH "/home/wis2downloader/app/logs" ENV WIS2DOWNLOADER_CONFIG "/home/wis2downloader/app/config/config.json" -#ENV GROUP_ID 1002 -#ENV USER_ID 1002 +ENV HOST_UID 1002 +ENV HOST_GID 1002 # Update, upgrade packages and install / clean up RUN apt-get update && \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index efc5237..73e29a8 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,14 +1,10 @@ #!/bin/bash -echo "$(id -u):$(id -g)" # Update build uid and gid to align with those of instance -usermod -u 1020 wis2downloader -groupmod -g 127 wis2 - -# remove wis2downloader from sudo group -sudo "usermod -g wis2 wis2downloader" +usermod -u ${HOST_UID} wis2downloader +groupmod -g ${HOST_GID} wis2 # now demote to wis2downlaoder user -su -c wis2downloader +su - wis2downloader # print the download_dir echo "Download directory in container: $DOWNLOAD_DIR"