From d8318f2ae23f5299bad2cdfb07a549bc74d83d3f Mon Sep 17 00:00:00 2001 From: Hemna Date: Mon, 17 Jul 2023 21:57:39 +0000 Subject: [PATCH] Update Dockerfile-dev to fix plugin permissions This patch changes the user creation to include creating a home directory so the plugin install installs those plugins as a --user option. --- docker/Dockerfile-dev | 4 ++-- docker/bin/admin.sh | 2 +- docker/bin/listen.sh | 2 +- docker/bin/run.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile-dev b/docker/Dockerfile-dev index cc0971f..8fcee26 100644 --- a/docker/Dockerfile-dev +++ b/docker/Dockerfile-dev @@ -12,12 +12,11 @@ ENV PIP_DEFAULT_TIMEOUT=100 \ # cache is useless in docker image, so disable to reduce image size PIP_NO_CACHE_DIR=1 -WORKDIR /app RUN set -ex \ # Create a non-root user && addgroup --system --gid 1001 appgroup \ - && adduser --system --uid 1001 --gid 1001 --no-create-home appuser \ + && useradd --uid 1001 --gid 1001 -s /usr/bin/bash -m -d /app appuser \ # Upgrade the package index and install security upgrades && apt-get update \ && apt-get upgrade -y \ @@ -31,6 +30,7 @@ RUN set -ex \ ### Final stage FROM build as final +WORKDIR /app RUN git clone -b $APRSD_BRANCH https://github.com/craigerl/aprsd RUN cd aprsd && pip install --no-cache-dir . diff --git a/docker/bin/admin.sh b/docker/bin/admin.sh index 35dbf4c..3fb5235 100755 --- a/docker/bin/admin.sh +++ b/docker/bin/admin.sh @@ -9,7 +9,7 @@ if [ ! -z "${APRSD_PLUGINS}" ]; then IFS=$OLDIFS # call your procedure/other scripts here below echo "Installing '$plugin'" - pip3 install $plugin + pip3 install --user $plugin done fi diff --git a/docker/bin/listen.sh b/docker/bin/listen.sh index 227b7e8..b1a0a04 100755 --- a/docker/bin/listen.sh +++ b/docker/bin/listen.sh @@ -9,7 +9,7 @@ if [ ! -z "${APRSD_PLUGINS}" ]; then IFS=$OLDIFS # call your procedure/other scripts here below echo "Installing '$plugin'" - pip3 install $plugin + pip3 install --user $plugin done fi diff --git a/docker/bin/run.sh b/docker/bin/run.sh index 68e993c..9a7ee1d 100755 --- a/docker/bin/run.sh +++ b/docker/bin/run.sh @@ -9,7 +9,7 @@ if [ ! -z "${APRSD_PLUGINS}" ]; then IFS=$OLDIFS # call your procedure/other scripts here below echo "Installing '$plugin'" - pip3 install $plugin + pip3 install --user $plugin done fi