From 9d3d6348ab08386be79921b604e8cf1a57f7dc6b Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Thu, 17 Dec 2020 13:58:39 -0800 Subject: [PATCH] Update Dockerfile --- .devcontainer/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 82497ce..11dd188 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,10 +6,11 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} ENV PIP_TARGET=/usr/local/pip-global ENV PYTHONPATH=${PIP_TARGET}:${PYTHONPATH} ENV PATH=${PIP_TARGET}/bin:${PATH} -RUN mkdir -p ${PIP_TARGET} \ - && chown vscode:root ${PIP_TARGET} \ - && echo "if [ \"\$(stat -c '%U' ${PIP_TARGET})\" != \"vscode\" ]; then chown -R vscode:root ${PIP_TARGET}; fi" \ - | tee -a /root/.bashrc /home/vscode/.bashrc /root/.zshrc >> /home/vscode/.zshrc +RUN if ! cat /etc/group | grep -e "^pip-global:" > /dev/null 2>&1; then groupadd -r pip-global; fi \ + && usermod -a -G pip-global vscode \ + && umask 0002 && mkdir -p ${PIP_TARGET} \ + && chown :pip-global ${PIP_TARGET} \ + && [ -f "/etc/profile.d/00-restore-env.sh" ] && sed -i -e "s/export PATH=/export PATH=\/usr\/local\/pip-global:/" /etc/profile.d/00-restore-env.sh # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. # COPY requirements.txt /tmp/pip-tmp/