From 0871c4fa07482759c211a429d0f9ca3e29569f21 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 21 Mar 2025 20:18:55 +0000 Subject: [PATCH] mounted home drive to not keep mounting drive --- .devcontainer/Dockerfile | 14 +++++++++----- .devcontainer/devcontainer.json | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 45e6e3c..7674c1d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,13 +2,17 @@ FROM library/python:3.12-bullseye ARG USER=vscode ARG DEBIAN_FRONTEND=noninteractive -RUN apt update \ - && apt install -y --no-install-recommends sudo \ + +# Install system dependencies in a single layer +RUN apt update && apt install -y --no-install-recommends \ + sudo jq vim \ && apt autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && useradd -m -s /usr/bin/bash ${USER} \ + && rm -rf /var/lib/apt/lists/* + +# Create the user and grant sudo privileges +RUN useradd -m -s /usr/bin/bash ${USER} \ && echo "${USER} ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/${USER} \ && chmod 0440 /etc/sudoers.d/${USER} # Install Poetry -RUN pip install poetry \ No newline at end of file +RUN pip install --no-cache-dir poetry diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5462694..b264a11 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,6 +3,9 @@ "build": { "dockerfile": "Dockerfile" }, "remoteUser": "vscode", "postStartCommand": "bash .devcontainer/post-install.sh", + "mounts": [ + "source=${localEnv:HOME},target=/workspaces/home,type=bind" + ], "customizations": { "vscode": { "extensions": [