From 8ee8005107221d925ae8f1c65a99ccc8222c37c8 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Wed, 18 Nov 2026 23:36:47 +0000 Subject: [PATCH] Add devcontainer configuration --- .devcontainer/Dockerfile | 26 +++++++++++ .devcontainer/devcontainer-lock.json | 9 ++++ .devcontainer/devcontainer.json | 69 ++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..831d83e --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,26 @@ +FROM docker.io/library/node:22-bookworm-slim AS node +FROM mcr.microsoft.com/devcontainers/base:bookworm +USER root +RUN apt-get update && apt-get install -y --no-install-recommends \ + bash-completion ca-certificates curl fzf git git-lfs gnupg openssh-client ripgrep zoxide build-essential clang clangd cmake gdb valgrind universal-ctags cscope \ + && rm -rf /var/lib/apt/lists/* +COPY --from=node /usr/local/bin/node /usr/local/bin/node +COPY --from=node /usr/local/lib/node_modules/npm/ /usr/local/lib/node_modules/npm/ +RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ + && ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \ + && node --version && npm --version +RUN apt-get update \ + && arch="$(dpkg --print-architecture)" \ + && case "$arch" in \ + amd64) sha256=ea4f0222950ee750a3d38dd80d03bce4cee07a3f63928fc47548383bcaf23093 ;; \ + arm64) sha256=0edc36cf514f1bd84becac3e94ee8ae9f8818c6a1f99f7b2ee67b362afa253d3 ;; \ + *) echo "Unsupported architecture for delta: $arch" >&2; exit 1 ;; \ + esac \ + && curl -fsSL --retry 3 "https://github.com/dandavison/delta/releases/download/0.19.2/git-delta_0.19.2_${arch}.deb" -o /tmp/git-delta.deb \ + && echo "$sha256 /tmp/git-delta.deb" | sha256sum -c - \ + && apt-get install -y --no-install-recommends /tmp/git-delta.deb \ + && rm -rf /var/lib/apt/lists/* /tmp/git-delta.deb +RUN usermod --home '/home/fscotto' --move-home vscode +ENV HOME="/home/fscotto" +USER vscode +RUN git config --global include.path /run/host-gitconfig diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 0000000..96d8688 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,9 @@ +{ + "features": { + "ghcr.io/devcontainers/features/node:1": { + "version": "1.7.1", + "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6", + "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..9c65453 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,69 @@ +{ + "build": { + "dockerfile": "Dockerfile" + }, + "containerEnv": { + "HOME": "/home/fscotto" + }, + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode", + "github.remotehub", + "ms-azuretools.vscode-containers", + "ms-vscode-remote.remote-containers", + "ms-vscode-remote.remote-ssh", + "ms-vscode-remote.remote-ssh-edit", + "ms-vscode-remote.remote-wsl", + "ms-vscode-remote.vscode-remote-extensionpack", + "ms-vscode.azure-repos", + "ms-vscode.cmake-tools", + "ms-vscode.cpptools", + "ms-vscode.remote-explorer", + "ms-vscode.remote-repositories", + "ms-vscode.remote-server", + "pkief.material-icon-theme", + "redhat.vscode-xml", + "redhat.vscode-yaml", + "saoudrizwan.claude-dev", + "vscodevim.vim" + ] + } + }, + "mounts": [ + { + "type": "bind", + "source": "${localEnv:HOME}/.gitconfig", + "target": "/run/host-gitconfig", + "readOnly": true + }, + { + "type": "bind", + "source": "${localEnv:HOME}/.gitignore_global", + "target": "/home/fscotto/.gitignore_global", + "readOnly": true + }, + { + "type": "bind", + "source": "${localEnv:HOME}/.config/ai", + "target": "/home/fscotto/.config/ai", + "readOnly": true + }, + { + "type": "bind", + "source": "${localEnv:HOME}/.cline", + "target": "/home/fscotto/.cline", + "readOnly": false + }, + { + "type": "bind", + "source": "${localEnv:HOME}/.agents", + "target": "/home/fscotto/.agents", + "readOnly": false + } + ], + "name": "fsnap — c-cpp", + "postCreateCommand": "sudo npm install --global --no-audit --no-fund 'cline'", + "remoteUser": "vscode", + "updateRemoteUserUID": true +}