Skip to content

Commit

Permalink
docker dev environment fix permissions
Browse files Browse the repository at this point in the history
Problem: permissions are written as root in the current devcontainer
Solution: run them as the vscode user with uid/gid 1000
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Feb 26, 2023
1 parent 73f715b commit 5186f93
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM fluxrm/flux-sched:focal

# Match the default user id for a single system so we aren't root
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=1000
ENV USERNAME=${USERNAME}
ENV USER_UID=${USER_UID}
ENV USER_GID=${USER_GID}

LABEL maintainer="Vanessasaurus <@vsoch>"

# Pip not provided in this version
Expand All @@ -17,5 +25,11 @@ RUN python3 -m pip install IPython && \
# For developer convenience
ln -s /usr/bin/python3 /usr/bin/python

# Add the group and user that match our ids
RUN groupadd -g ${USER_GID} ${USERNAME} && \
adduser --disabled-password --uid ${USER_UID} --gid ${USER_GID} --gecos "" ${USERNAME} && \
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
USER $USERNAME

ENV PATH=/env/bin:${PATH}
WORKDIR /workspace/flux-docs

0 comments on commit 5186f93

Please sign in to comment.