diff --git a/docker/Dockerfile b/docker/Dockerfile index e619666..7faae5d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,10 +14,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ less \ && rm -rf /var/lib/apt/lists/* +ARG UID=1000 +ARG GID=1000 ENV USER pytfa ENV HOME /home/$USER -RUN useradd -ms "/bin/bash" "$USER" +RUN groupadd -g "${GID}" "$USER" && useradd -u "${UID}" -g "$USER" -ms "/bin/bash" "$USER" USER $USER WORKDIR $HOME diff --git a/docker/build b/docker/build index 0b900ea..81704d3 100644 --- a/docker/build +++ b/docker/build @@ -1,2 +1,2 @@ #!/bin/sh -docker build -t pytfa_docker . +docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t pytfa_docker . diff --git a/docker/run b/docker/run index 791d716..316fd9d 100644 --- a/docker/run +++ b/docker/run @@ -1,5 +1,5 @@ #!/bin/sh -docker run --rm -it \ +docker run --rm -it \ -v $(pwd)/work:/home/pytfa/work \ -v $(pwd)/..:/src/pytfa \ pytfa_docker