Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use host user UID and GID #10

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker/build
Original file line number Diff line number Diff line change
@@ -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 .
2 changes: 1 addition & 1 deletion docker/run
Original file line number Diff line number Diff line change
@@ -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