Skip to content

refactor: unify devcontainer templates under noble base image and upd…#24

Merged
PabloZaiden merged 1 commit into
mainfrom
better-devcontainer-templates
Apr 25, 2026
Merged

refactor: unify devcontainer templates under noble base image and upd…#24
PabloZaiden merged 1 commit into
mainfrom
better-devcontainer-templates

Conversation

@PabloZaiden
Copy link
Copy Markdown
Owner

This pull request standardizes all built-in devcontainer templates to use the Ubuntu noble base image with Docker-in-Docker, and replaces the previous Node.js/TypeScript and Bun templates with a unified typescript template that uses devcontainer features for Node.js and Bun. The changes also update tests and documentation to reflect these new templates and configurations.

Template standardization and unification:

  • All built-in templates now use the mcr.microsoft.com/devcontainers/base:noble image as their base, with the Docker-in-Docker feature preinstalled. This replaces previous images based on Ubuntu 24.04, Debian bookworm, and Debian trixie.
  • The separate node-typescript and bun templates are removed and replaced with a single typescript template that includes both Node.js and Bun via devcontainer features. [1] [2]
  • The typescript template is now exposed in template summaries and is verified in tests.

Template implementation improvements:

  • A new createTemplateDefinition helper function is introduced to generate template definitions consistently, including the correct base image and features.
  • All templates now specify their devcontainer features using a standardized mechanism, making it easier to extend or modify templates in the future.

Test and documentation updates:

  • Tests are updated to expect the new base image, feature configuration, and unified template structure. This includes updates to both core logic and example workspace tests. [1] [2] [3] [4]
  • The README.md is updated to reflect the new set of built-in templates.…ate features

…ate features

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 25, 2026 14:56
@PabloZaiden PabloZaiden enabled auto-merge (squash) April 25, 2026 14:57
@PabloZaiden PabloZaiden merged commit f70f011 into main Apr 25, 2026
3 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes all built-in devcontainer templates onto the Ubuntu noble base image with Docker-in-Docker, and replaces the prior Node.js/TypeScript and Bun templates with a single unified typescript template built via devcontainer features.

Changes:

  • Introduces a createTemplateDefinition helper to generate consistent template definitions (base image + standardized features).
  • Replaces node-typescript and bun with a unified typescript template that composes Node.js + Bun features.
  • Updates tests and README to reflect the new templates, base image, and expected generated configs/output.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/templates.ts Refactors template definitions to use a single noble base image + Docker-in-Docker and adds a helper for consistency; introduces unified typescript template.
tests/templates.test.ts Updates template tests for noble base + feature-based typescript template and verifies all templates include Docker-in-Docker.
tests/examples.test.ts Updates example-workspace expectations for template listing and generated config shape (image + features).
tests/examples.live.test.ts Makes arise output assertion resilient to variable counts via regex.
tests/core.test.ts Updates resolveWorkspaceConfig expectations to match feature-based template configs.
README.md Updates the list of built-in templates to include typescript and remove the old templates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/templates.ts
Comment on lines +29 to +38
const BASE_IMAGE = "mcr.microsoft.com/devcontainers/base:noble";
const BASE_NAME = "noble";
const DOCKER_IN_DOCKER_FEATURE = "ghcr.io/devcontainers/features/docker-in-docker:2";
const DOTNET_FEATURE = "ghcr.io/devcontainers/features/dotnet:2";
const GO_FEATURE = "ghcr.io/devcontainers/features/go:1";
const JAVA_FEATURE = "ghcr.io/devcontainers/features/java:1";
const NODE_FEATURE = "ghcr.io/devcontainers/features/node:1";
const RUST_FEATURE = "ghcr.io/devcontainers/features/rust:1";
const BUN_FEATURE = "ghcr.io/devcontainers-extra/features/bun:1";
const UV_FEATURE = "ghcr.io/devcontainers-extra/features/uv:1";
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BASE_IMAGE is set to mcr.microsoft.com/devcontainers/base:noble and pinnedReference is built from that tag plus major-version feature refs. Since tags/major refs are mutable, this makes the "pinnedReference" value non-reproducible and potentially misleading (it’s not actually pinned). Consider using a versioned image tag or digest for the base image (and more specific feature refs where possible), or rename/split the field so consumers don’t interpret it as a stable/pinned reference.

Suggested change
const BASE_IMAGE = "mcr.microsoft.com/devcontainers/base:noble";
const BASE_NAME = "noble";
const DOCKER_IN_DOCKER_FEATURE = "ghcr.io/devcontainers/features/docker-in-docker:2";
const DOTNET_FEATURE = "ghcr.io/devcontainers/features/dotnet:2";
const GO_FEATURE = "ghcr.io/devcontainers/features/go:1";
const JAVA_FEATURE = "ghcr.io/devcontainers/features/java:1";
const NODE_FEATURE = "ghcr.io/devcontainers/features/node:1";
const RUST_FEATURE = "ghcr.io/devcontainers/features/rust:1";
const BUN_FEATURE = "ghcr.io/devcontainers-extra/features/bun:1";
const UV_FEATURE = "ghcr.io/devcontainers-extra/features/uv:1";
const BASE_IMAGE =
"mcr.microsoft.com/devcontainers/base:noble@sha256:<REPLACE_WITH_PUBLISHED_BASE_IMAGE_DIGEST>";
const BASE_NAME = "noble";
const DOCKER_IN_DOCKER_FEATURE =
"ghcr.io/devcontainers/features/docker-in-docker@sha256:<REPLACE_WITH_PUBLISHED_DOCKER_IN_DOCKER_DIGEST>";
const DOTNET_FEATURE =
"ghcr.io/devcontainers/features/dotnet@sha256:<REPLACE_WITH_PUBLISHED_DOTNET_DIGEST>";
const GO_FEATURE =
"ghcr.io/devcontainers/features/go@sha256:<REPLACE_WITH_PUBLISHED_GO_DIGEST>";
const JAVA_FEATURE =
"ghcr.io/devcontainers/features/java@sha256:<REPLACE_WITH_PUBLISHED_JAVA_DIGEST>";
const NODE_FEATURE =
"ghcr.io/devcontainers/features/node@sha256:<REPLACE_WITH_PUBLISHED_NODE_DIGEST>";
const RUST_FEATURE =
"ghcr.io/devcontainers/features/rust@sha256:<REPLACE_WITH_PUBLISHED_RUST_DIGEST>";
const BUN_FEATURE =
"ghcr.io/devcontainers-extra/features/bun@sha256:<REPLACE_WITH_PUBLISHED_BUN_DIGEST>";
const UV_FEATURE =
"ghcr.io/devcontainers-extra/features/uv@sha256:<REPLACE_WITH_PUBLISHED_UV_DIGEST>";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants