Repository navigation
Cmaneu/devcontainers with kind #1634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cde4041
WIP - Kind
cmaneu e282690
fix(devcontainer): make Kind mode start and serve the Portal
cmaneu 7ff469d
chore: remove unused k3d tooling
cmaneu d9f5745
docs: document devcontainer Kind mode and local run options
cmaneu 8ca83a8
build(devcontainer): install git-lfs
cmaneu 403602e
Warn on low disk before Kind builds
Copilot 4bd5b0e
Configure Codespaces resources and port forwarding
Copilot 7139da1
Merge remote-tracking branch 'origin/main' into cmaneu/devcontainers-…
Copilot b55992c
Fix devcontainer workflow checks
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| FROM node:22.22.0-bookworm@sha256:20a424ecd1d2064a44e12fe287bf3dae443aab31dc5e0c0cb6c74bef9c78911c | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| ca-certificates curl git git-lfs sudo openssl mkcert libnss3-tools iptables jq \ | ||
| build-essential pkg-config libssl-dev cmake clang lldb libclang-dev \ | ||
| python3 python3-venv python3-pip xz-utils unzip chromium xvfb x11vnc novnc websockify \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && git lfs install --system --skip-repo \ | ||
| && printf 'node ALL=(root) NOPASSWD:ALL\n' > /etc/sudoers.d/node \ | ||
| && chmod 0440 /etc/sudoers.d/node | ||
|
|
||
| ARG TARGETARCH | ||
| RUN set -eu; \ | ||
| case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH"; exit 1 ;; esac; \ | ||
| curl -fsSLo /tmp/kind "https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-${TARGETARCH}"; \ | ||
| curl -fsSLo /tmp/kind.sha256 "https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-${TARGETARCH}.sha256sum"; \ | ||
| cd /tmp; sed "s/kind-linux-${TARGETARCH}/kind/" kind.sha256 | sha256sum -c -; \ | ||
| install -m 0755 kind /usr/local/bin/kind; \ | ||
| curl -fsSLo kubectl "https://dl.k8s.io/release/v1.32.2/bin/linux/${TARGETARCH}/kubectl"; \ | ||
| curl -fsSLo kubectl.sha256 "https://dl.k8s.io/release/v1.32.2/bin/linux/${TARGETARCH}/kubectl.sha256"; \ | ||
| printf '%s kubectl\n' "$(cat kubectl.sha256)" | sha256sum -c -; \ | ||
| install -m 0755 kubectl /usr/local/bin/kubectl; \ | ||
| rm -f /tmp/kind /tmp/kind.sha256 /tmp/kubectl /tmp/kubectl.sha256 | ||
|
|
||
| ARG COMPOSE_VERSION=v2.35.1 | ||
| ARG BUILDX_VERSION=v0.22.0 | ||
| RUN set -eu; \ | ||
| case "$TARGETARCH" in amd64) compose_arch=x86_64 ;; arm64) compose_arch=aarch64 ;; esac; \ | ||
| mkdir -p /usr/local/lib/docker/cli-plugins; \ | ||
| cd /tmp; \ | ||
| curl -fsSLO "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/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-${compose_arch}"; \ | ||
| curl -fsSLO "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/docker/compose/releases/download/${COMPOSE_VERSION}/checksums.txt"; \ | ||
| grep "docker-compose-linux-${compose_arch}$" checksums.txt | sha256sum -c -; \ | ||
| install -m 0755 "docker-compose-linux-${compose_arch}" /usr/local/lib/docker/cli-plugins/docker-compose; \ | ||
| curl -fsSLO "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/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-${TARGETARCH}"; \ | ||
| curl -fsSLo buildx-checksums.txt "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/docker/buildx/releases/download/${BUILDX_VERSION}/checksums.txt"; \ | ||
| grep "buildx-${BUILDX_VERSION}.linux-${TARGETARCH}$" buildx-checksums.txt | sha256sum -c -; \ | ||
| install -m 0755 "buildx-${BUILDX_VERSION}.linux-${TARGETARCH}" /usr/local/lib/docker/cli-plugins/docker-buildx; \ | ||
| rm -f /tmp/docker-compose-linux-* /tmp/buildx-* /tmp/checksums.txt | ||
|
|
||
| COPY package.json /tmp/scope-package.json | ||
| RUN npm install -g "$(node -p 'require("/tmp/scope-package.json").packageManager')" \ | ||
| && rm /tmp/scope-package.json | ||
|
|
||
| COPY .devcontainer/install-tools.sh /tmp/install-tools.sh | ||
| RUN bash /tmp/install-tools.sh "$TARGETARCH" && rm /tmp/install-tools.sh | ||
| ENV PATH="/opt/cargo/bin:${PATH}" RUSTUP_HOME=/opt/rustup | ||
|
|
||
| USER node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/docker-in-docker:4.1.3": { | ||
| "version": "4.1.3", | ||
| "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:fae40f3c8be5a7c3b0db344c1d30341bc2c91ba38d1d5b14cd2ad72e6d65d084", | ||
| "integrity": "sha256:fae40f3c8be5a7c3b0db344c1d30341bc2c91ba38d1d5b14cd2ad72e6d65d084" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "name": "Scope development (DinD + native/Kind)", | ||
| "build": { "dockerfile": "Dockerfile", "context": ".." }, | ||
| "hostRequirements": { "cpus": 8, "memory": "32gb", "storage": "64gb" }, | ||
| "remoteUser": "node", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/docker-in-docker:4.1.3": { | ||
| "version": "29.3.0", | ||
| "moby": false, | ||
| "dockerDashComposeVersion": "none", | ||
| "installDockerBuildx": false | ||
| } | ||
| }, | ||
| "containerEnv": { | ||
| "COMPOSE_PARALLEL_LIMIT": "2", | ||
| "SCOPE_DIND_SPIKE": "1", | ||
| "SCOPE_DEV_DATA": "/home/node/.scope-state", | ||
| "CARGO_HOME": "/home/node/.cargo", | ||
| "RUSTUP_HOME": "/opt/rustup" | ||
| }, | ||
| "mounts": [ | ||
| "source=scope-pnpm-${devcontainerId},target=/home/node/.local/share/pnpm/store,type=volume", | ||
| "source=scope-cargo-${devcontainerId},target=/home/node/.cargo,type=volume", | ||
| "source=scope-data-${devcontainerId},target=/home/node/.scope-state,type=volume" | ||
| ], | ||
| "postCreateCommand": "sudo -n chown node:node /home/node/.local/share/pnpm/store /home/node/.cargo /home/node/.scope-state && pnpm install --frozen-lockfile && pnpm exec tsx scripts/dev/control.ts create", | ||
| "postStartCommand": "pnpm exec tsx scripts/dev/control.ts start", | ||
| "postAttachCommand": "pnpm exec tsx scripts/dev/control.ts attach", | ||
| "forwardPorts": [8080], | ||
| "portsAttributes": { | ||
| "8080": { "label": "dev-edge (Codespaces HTTP transport)", "protocol": "http", "requireLocalPort": true, "onAutoForward": "notify" }, | ||
| "8443": { "label": "dev-edge (local HTTPS)", "protocol": "https", "requireLocalPort": true, "onAutoForward": "ignore" }, | ||
| "18443": { "onAutoForward": "ignore" } | ||
| }, | ||
| "otherPortsAttributes": { "onAutoForward": "ignore" }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { "remote.autoForwardPorts": false }, | ||
| "extensions": ["vadimcn.vscode-lldb", "rust-lang.rust-analyzer", "ms-python.python", "ms-python.debugpy"] | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| architecture="${1:?architecture required}" | ||
| case "$architecture" in | ||
| amd64) triple=x86_64-unknown-linux-gnu; powershell_arch=x64 ;; | ||
| arm64) triple=aarch64-unknown-linux-gnu; powershell_arch=arm64 ;; | ||
| *) echo "Unsupported architecture: $architecture" >&2; exit 1 ;; | ||
| esac | ||
| temporary=$(mktemp -d) | ||
| trap 'rm -rf "$temporary"' EXIT | ||
| cd "$temporary" | ||
|
|
||
| curl -fsSLo rustup-init "https://static.rust-lang.org/rustup/archive/1.28.2/${triple}/rustup-init" | ||
| curl -fsSLo rustup-init.sha256 "https://static.rust-lang.org/rustup/archive/1.28.2/${triple}/rustup-init.sha256" | ||
| sha256sum -c rustup-init.sha256 | ||
| chmod +x rustup-init | ||
| export CARGO_HOME=/opt/cargo RUSTUP_HOME=/opt/rustup | ||
| ./rustup-init -y --no-modify-path --default-toolchain 1.88.0 --profile minimal --component rustfmt,clippy | ||
| export PATH="/opt/cargo/bin:$PATH" | ||
| cargo install cargo-watch --locked --version 8.5.3 | ||
|
|
||
| curl -fsSLO "https://nodejs.org/dist/v24.21.0/node-v24.21.0-linux-${powershell_arch/x64/x64}.tar.xz" | ||
| curl -fsSLO https://nodejs.org/dist/v24.21.0/SHASUMS256.txt | ||
| grep "node-v24.21.0-linux-${powershell_arch}.tar.xz$" SHASUMS256.txt | sha256sum -c - | ||
| mkdir -p /opt/node24 | ||
| tar -xJf "node-v24.21.0-linux-${powershell_arch}.tar.xz" -C /opt/node24 --strip-components=1 | ||
| ln -s /usr/local/bin/node /usr/local/bin/node22 | ||
| ln -s /opt/node24/bin/node /usr/local/bin/node24 | ||
|
|
||
| curl -fsSLO "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/astral-sh/uv/releases/download/0.10.0/uv-${triple}.tar.gz" | ||
| curl -fsSLO "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/astral-sh/uv/releases/download/0.10.0/uv-${triple}.tar.gz.sha256" | ||
| sha256sum -c "uv-${triple}.tar.gz.sha256" | ||
| tar -xzf "uv-${triple}.tar.gz" | ||
| install -m 0755 "uv-${triple}/uv" "uv-${triple}/uvx" /usr/local/bin/ | ||
|
|
||
| curl -fsSLO "https://get.helm.sh/helm-v3.17.2-linux-${architecture}.tar.gz" | ||
| curl -fsSLO "https://get.helm.sh/helm-v3.17.2-linux-${architecture}.tar.gz.sha256sum" | ||
| sha256sum -c "helm-v3.17.2-linux-${architecture}.tar.gz.sha256sum" | ||
| tar -xzf "helm-v3.17.2-linux-${architecture}.tar.gz" | ||
| install -m 0755 "linux-${architecture}/helm" /usr/local/bin/helm | ||
|
|
||
| curl -fsSLo skaffold "https://storage.googleapis.com/skaffold/releases/v2.15.0/skaffold-linux-${architecture}" | ||
| curl -fsSLo skaffold.sha256 "https://storage.googleapis.com/skaffold/releases/v2.15.0/skaffold-linux-${architecture}.sha256" | ||
| printf '%s skaffold\n' "$(awk '{print $1}' skaffold.sha256)" | sha256sum -c - | ||
| install -m 0755 skaffold /usr/local/bin/skaffold | ||
|
|
||
| curl -fsSLO "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/cli/cli/releases/download/v2.67.0/gh_2.67.0_linux_${architecture}.tar.gz" | ||
| curl -fsSLO https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_checksums.txt | ||
| grep "gh_2.67.0_linux_${architecture}.tar.gz$" gh_2.67.0_checksums.txt | sha256sum -c - | ||
| tar -xzf "gh_2.67.0_linux_${architecture}.tar.gz" | ||
| install -m 0755 "gh_2.67.0_linux_${architecture}/bin/gh" /usr/local/bin/gh | ||
|
|
||
| curl -fsSLo powershell.tar.gz "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/PowerShell/PowerShell/releases/download/v7.4.14/powershell-7.4.14-linux-${powershell_arch}.tar.gz" | ||
| curl -fsSLo powershell-hashes.txt https://github.com/PowerShell/PowerShell/releases/download/v7.4.14/hashes.sha256 | ||
| expected=$(iconv -f UTF-16 -t UTF-8 powershell-hashes.txt | tr -d '\r' | grep -i "powershell-7.4.14-linux-${powershell_arch}.tar.gz$" | awk '{print tolower($1)}') | ||
| printf '%s powershell.tar.gz\n' "$expected" | sha256sum -c - | ||
| mkdir -p /opt/powershell | ||
| tar -xzf powershell.tar.gz -C /opt/powershell | ||
| chmod +x /opt/powershell/pwsh | ||
| ln -s /opt/powershell/pwsh /usr/local/bin/pwsh | ||
|
|
||
| uv venv /opt/azure-cli | ||
| uv pip install --python /opt/azure-cli/bin/python --prerelease=allow azure-cli==2.68.0 | ||
| ln -s /opt/azure-cli/bin/az /usr/local/bin/az |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - resources.json |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.