Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 0f34161

Browse files
committed
convert devcontainer to use mcr base image
1 parent b8d8093 commit 0f34161

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
FROM python:3.10
1+
# Fmore information about the base image visit:
2+
# https://mcr.microsoft.com/en-us/artifact/mar/devcontainers/python/about
3+
FROM mcr.microsoft.com/devcontainers/python:3.10-bookworm
24

3-
# avoid common warnings
5+
# disable common warning messages
46
ENV DEBIAN_FRONTEND=noninteractive
57
ENV PIP_ROOT_USER_ACTION=ignore
68
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
79

810
# configure environment
911
ARG ENVNAME="GraphRAG"
1012
ARG USERNAME=vscode
11-
ARG USER_UID=1001
12-
ARG USER_GID=$USER_UID
1313
ARG WORKDIR=/${ENVNAME}
1414

1515
# install python, pip, git, and other required tools
@@ -53,13 +53,11 @@ RUN rm -rf /var/lib/apt/lists/* \
5353
# set the location for the virtual environments to be outside the project directory
5454
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
5555

56-
# set up non-root user
57-
RUN useradd -ms /bin/bash -u ${USER_GID} ${USERNAME} \
58-
&& echo "${USERNAME}:${USERNAME}" | chpasswd \
59-
# add user to sudo group and docker group
56+
# a non-root user (vscode) already exist in the base image. Add it to sudo group and docker group
57+
RUN echo "${USERNAME}:${USERNAME}" | chpasswd \
6058
&& adduser ${USERNAME} sudo \
61-
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
62-
&& usermod -aG docker ${USERNAME}
59+
&& adduser ${USERNAME} docker \
60+
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
6361

6462
# switch to non-root user
6563
USER ${USERNAME}
@@ -73,13 +71,13 @@ ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"
7371
ENV PATH=/graphrag-accelerator/.venv/bin:$PATH
7472

7573
# copy the project files into the container and set ownership
76-
COPY --chown=${USERNAME}:${USER_GID} . ${WORKDIR}
74+
COPY --chown=${USERNAME}:${USERNAME} . ${WORKDIR}
7775

7876
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
7977

8078
# Create directories for vscode server and extensions
81-
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \
82-
&& chown -R $USER_UID:$USER_GID /home/$USERNAME/.vscode-server
79+
RUN mkdir -p ~/.vscode-server/extensions \
80+
&& chown -R $USERNAME:$USERNAME ~/.vscode-server
8381

8482
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
8583
CMD ["bash"]

0 commit comments

Comments
 (0)