diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6363071..c1418e5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,5 @@ +FROM ghcr.io/devcontainer-config/features/dotnet/sdk:10 as dotnet + FROM mcr.microsoft.com/devcontainers/javascript-node:24-bookworm RUN apt-get update \ @@ -10,3 +12,5 @@ RUN apt-get update \ RUN mkdir --parents /usr/share/dotnet /usr/share/devcontainer-config/NuGet/global-packages \ && chmod --recursive a+rwX /usr/share/dotnet /usr/share/devcontainer-config + +COPY --from=dotnet /features/dotnet/ /opt/devcontainer-config/features/dotnet/ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f7e1e29..44e5a2a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,11 +22,12 @@ "features": { // "ghcr.io/devcontainer-config/features/user-init:3": {}, // "ghcr.io/devcontainer-config/features/dot-config:4": {}, + // "ghcr.io/devcontainer-config/features/features": {}, "./features/src/user-init": {}, "./features/src/dot-config": {}, + "./features/src/features": {}, "./features/src/unset-git-credential-helper": {}, - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, - "ghcr.io/devcontainers/features/dotnet:2": { "version": "10.0" } + "ghcr.io/devcontainers/features/docker-in-docker:4": {} }, "customizations": { "vscode": { diff --git a/.devcontainer/features/test/features/index.test.ts b/.devcontainer/features/test/features/index.test.ts index 0c2bf26..a3d9ee3 100644 --- a/.devcontainer/features/test/features/index.test.ts +++ b/.devcontainer/features/test/features/index.test.ts @@ -6,7 +6,7 @@ import { expect, test } from "vitest"; const featuresRun = "/opt/devcontainer-config/features-run"; const featuresPathFile = "/opt/devcontainer-config/features-path"; -const hooks = ["install", "entrypoint", "onCreate", "updateContent", "postCreate", "postStart", "postAttach"] as const; +const lifecycleHooks = ["onCreate", "updateContent", "postCreate", "postStart", "postAttach"] as const; test("dispatcher is installed as an executable file", async () => { const stats = await stat(featuresRun); @@ -28,9 +28,9 @@ test("unknown or missing hook exits 1", async () => { expect(missing.exitCode).toBe(1); }); -test("every hook exits 0 with no features staged", async () => { +test("every lifecycle hook exits 0 with features staged", async () => { const $$ = $({ reject: false, verbose: "short" }); - for (const hook of hooks) { + for (const hook of lifecycleHooks) { const result = await $$`${featuresRun} ${hook}`; expect(result.exitCode).toBe(0); }