From 8eca76e4648a738923541a29c735fa8fc77041b5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 22 Oct 2020 11:54:23 +0200 Subject: [PATCH] root: fix docker permission error --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8e5919cd1..3b5d729f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,14 @@ RUN apt-get update && \ pip install -r /requirements.txt --no-cache-dir && \ apt-get remove --purge -y build-essential && \ apt-get autoremove --purge -y && \ - adduser --system --no-create-home --uid 1000 --group --home /passbook passbook + # This is quite hacky, but docker has no guaranteed Group ID + # we could instead check for the GID of the socket and add the user dynamically, + # but then we have to drop permmissions later + groupadd -g 998 docker_998 && \ + groupadd -g 999 docker_999 && \ + adduser --system --no-create-home --uid 1000 --group --home /passbook passbook && \ + usermod -a -G docker_998 passbook && \ + usermod -a -G docker_999 passbook COPY ./passbook/ /passbook COPY ./manage.py /