From 95f3190bfd91066a2df3dd781f884185c549eb50 Mon Sep 17 00:00:00 2001 From: Christian Sutter Date: Thu, 21 May 2026 14:35:22 +0100 Subject: [PATCH] Move from mise to Make and DinD --- .devcontainer/Dockerfile | 23 +++++++++++++++++++++++ .devcontainer/devcontainer-lock.json | 9 +++++++++ .devcontainer/devcontainer.json | 12 ++++++++++++ .github/copilot-instructions.md | 12 ++++++------ Makefile | 16 ++++++++++++++++ mise.toml | 23 ----------------------- 6 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 .devcontainer/devcontainer.json create mode 100644 Makefile delete mode 100644 mise.toml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..5572e76 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,23 @@ +FROM debian:trixie-slim + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + bash \ + ca-certificates \ + curl \ + git \ + jq \ + make \ + shellcheck \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js 24.x and devcontainer CLI +RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && rm -rf /var/lib/apt/lists/* \ + && npm install -g @devcontainers/cli + +RUN groupadd --gid 1000 dev \ + && useradd --uid 1000 --gid dev --shell /bin/bash --create-home dev + +USER dev diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 0000000..5c99099 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,9 @@ +{ + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "2.17.0", + "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c", + "integrity": "sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..45339d0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "devcontainer-features", + "build": { + "dockerfile": "Dockerfile" + }, + "remoteUser": "dev", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": false + } + } +} diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f7d3a6f..82f2e5b 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -9,7 +9,7 @@ src// devcontainer-feature.json # Metadata, mounts, env vars, postCreateCommand install.sh # Runs at image build time (root, inside container) NOTES.md # Human-written design notes — update when making meaningful changes - README.md # Auto-generated — DO NOT edit directly, run `mise run docs` + README.md # Auto-generated — DO NOT edit directly, run `make docs` test// test.sh # Integration test run inside container after feature install ``` @@ -19,7 +19,7 @@ test// 1. Create `src//devcontainer-feature.json`, `install.sh`, and `NOTES.md` 2. Add `test//test.sh` covering every installed binary and configured file 3. Add the new feature to the top-level `README.md` features list -4. Run `mise run docs` to generate `src//README.md` +4. Run `make docs` to generate `src//README.md` ## `install.sh` Conventions @@ -42,14 +42,14 @@ reportResults - Add a `check` for every binary installed and every file/env var configured - Always write tests for new functionality before considering it complete -- Run tests: `mise run test` (tests against debian, ubuntu, fedora-toolbox, devcontainers/base:ubuntu) +- Run tests: `make test` (tests against debian, ubuntu, fedora-toolbox, devcontainers/base:ubuntu) ## Before Committing ```sh -mise run lint-shell # ShellCheck all .sh files -mise run docs # Regenerate README.md from devcontainer-feature.json + NOTES.md -mise run test # Full integration test suite (requires Docker) +make lint-shell # ShellCheck all .sh files +make docs # Regenerate README.md from devcontainer-feature.json + NOTES.md +make test # Full integration test suite (requires Docker) ``` ## NOTES.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..80e4817 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +.PHONY: help docs lint-shell test + +help: ## Show this help + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}' + +docs: ## Generate documentation for all features + devcontainer features generate-docs -p src -n csutter/devcontainer-features + +lint-shell: ## Lint all shell scripts using ShellCheck + find . -name '*.sh' -print0 | xargs -0 shellcheck + +test: ## Run tests for all features + devcontainer features test -i docker.io/library/debian:latest + devcontainer features test -i docker.io/library/ubuntu:latest + devcontainer features test -i quay.io/fedora/fedora-toolbox:latest + devcontainer features test -i mcr.microsoft.com/devcontainers/base:ubuntu diff --git a/mise.toml b/mise.toml deleted file mode 100644 index 1a2920c..0000000 --- a/mise.toml +++ /dev/null @@ -1,23 +0,0 @@ -[tools] -node = "24" -"npm:@devcontainers/cli" = "0.80" -"github:koalaman/shellcheck" = "v0.11.0" - -[tasks.docs] -description = "Generate documentation for all features" -# Note: The `generate-docs` command documentation wrongly suggests -p should be the root of the -# repo, but it should be the src/ directory. -run = "devcontainer features generate-docs -p src -n csutter/devcontainer-features" - -[tasks.lint-shell] -description = "Lint all shell scripts using ShellCheck" -run = "find . -name '*.sh' -print0 | xargs -0 shellcheck" - -[tasks.test] -description = "Run tests for all features" -run = [ - "devcontainer features test -i docker.io/library/debian:latest", - "devcontainer features test -i docker.io/library/ubuntu:latest", - "devcontainer features test -i quay.io/fedora/fedora-toolbox:latest", - "devcontainer features test -i mcr.microsoft.com/devcontainers/base:ubuntu", -]