From 5ec11c42cad7a0da28e6bc8d0b896200b0b8b824 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Fri, 22 May 2026 17:31:39 +0000 Subject: [PATCH 1/3] build: Add devcontainer config --- .devcontainer/devcontainer.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..fd09f821a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "Rust", + "image": "mcr.microsoft.com/devcontainers/rust:1", + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer" + ] + } + }, + "remoteUser": "vscode" +} From 16d209165c7b0930ee6d3a768178da14bc22163e Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Fri, 22 May 2026 17:40:26 +0000 Subject: [PATCH 2/3] build(devcontainer): Open contributing docs by default --- .devcontainer/devcontainer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fd09f821a..8320a76fa 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,6 +2,9 @@ "name": "Rust", "image": "mcr.microsoft.com/devcontainers/rust:1", "customizations": { + "codespaces": { + "openFiles": ["CONTRIBUTING.md", ".github/pull_request_template.md"] + }, "vscode": { "extensions": [ "rust-lang.rust-analyzer" From 84cd6ee4901abc7adccf6752b434ce1d8d1860a3 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Tue, 26 May 2026 14:22:05 +0000 Subject: [PATCH 3/3] Use devcontainer config from @im7mortal Co-authored-by: im7mortal <5336231+im7mortal@users.noreply.github.com> --- .devcontainer/Dockerfile | 23 +++++++++++++++++++++++ .devcontainer/devcontainer.json | 16 +++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..35138f9a6 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,23 @@ +FROM rust:1.95 + +# Match a typical host Linux UID/GID (override in devcontainer.json "build" -> "args" if needed) +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=1000 + +ENV RUSTUP_HOME=/usr/local/rustup +ENV CARGO_HOME=/usr/local/cargo + +RUN apt-get update && apt-get install -y --no-install-recommends \ + sudo \ + python3 \ + python3-pip \ + python3-matplotlib \ + && groupadd --gid $USER_GID $USERNAME \ + && useradd -s /bin/bash -m -u $USER_UID -g $USER_GID $USERNAME \ + && chown -R $USER_UID:$USER_GID $RUSTUP_HOME $CARGO_HOME \ + && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \ + && chmod 440 /etc/sudoers.d/$USERNAME \ + && rm -rf /var/lib/apt/lists/* + +USER $USERNAME diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8320a76fa..9483a5c7f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,15 @@ { - "name": "Rust", - "image": "mcr.microsoft.com/devcontainers/rust:1", + "name": "zip2", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + "build": { + "dockerfile": "Dockerfile", + "context": "..", + "args": { + "USER_UID": "1000", + "USER_GID": "1000" + } + }, + "postCreateCommand": "rustup component add rustfmt clippy", "customizations": { "codespaces": { "openFiles": ["CONTRIBUTING.md", ".github/pull_request_template.md"] @@ -11,5 +20,6 @@ ] } }, - "remoteUser": "vscode" + "remoteUser": "vscode", + "updateRemoteUserUID": false }