Skip to content

Conversation

@rjaegers
Copy link
Member

🚀 Hey, I have created a Pull Request

Description of changes

This pull request introduces a new modular build system for devcontainers by creating a reusable base image and updating the build pipelines, configuration, and Dockerfiles for both the C++ and Rust development containers. The main goals are to improve maintainability, speed up builds by leveraging a shared base image, and streamline CI/CD workflows.

The most important changes are:

1. Introduction of a Modular Base Image

  • Added .devcontainer/base/Dockerfile, which defines a new amp-devcontainer-base image with core dependencies, BATS testing tools, and common setup steps. This image is now used as the foundation for both C++ and Rust devcontainers. (.devcontainer/base/Dockerfile, .devcontainer/base/DockerfileR1-R55)
  • Created .devcontainer/base/apt-requirements-base.json and .devcontainer/base/devcontainer-metadata.json to manage base package versions and metadata centrally. [1] [2]

2. Refactoring of C++ and Rust Devcontainer Dockerfiles

  • Updated .devcontainer/cpp/Dockerfile and .devcontainer/rust/Dockerfile to use the new base image via the BASE_IMAGE build argument, removing duplicated setup logic and package installations now handled in the base. [1] [2]
  • Cleaned up their respective apt-requirements-base.json files to only include flavor-specific dependencies. [1] [2]

3. CI/CD Pipeline and Workflow Enhancements

  • Updated GitHub Actions workflows (continuous-integration.yml, release-build.yml) to add a dedicated job for building and pushing the base image before building the flavor-specific images. The flavor builds now depend on outputs from the base build, ensuring correct versioning and image layering. [1] [2] [3] [4]
  • Modified workflow call definitions to support new build arguments and devcontainer metadata injection.

4. Improved Local Development Experience

  • Added initializeCommand and build arguments to the flavor devcontainer.json files, ensuring the base image is built locally before building the flavor image and that the correct image versions are used. (.devcontainer/cpp/devcontainer.json, .devcontainer/rust/devcontainer.json, [1] [2]

5. Documentation and Release Process Updates

  • Updated the release template and workflow to include the new base image and ensure release notes are generated for all flavors, including the base. (.github/RELEASE_TEMPLATE.md, .github/workflows/release-build.yml, [1] [2]

✔️ Checklist

  • I have followed the contribution guidelines for this repository
  • I have added tests for new behavior, and have not broken any existing tests
  • I have added or updated relevant documentation
  • I have verified that all added components are accounted for in the SBOM

@rjaegers rjaegers requested a review from a team as a code owner January 14, 2026 14:24
Copilot AI review requested due to automatic review settings January 14, 2026 14:24
Copy link
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 pull request introduces a modular build system for amp-devcontainer by extracting common dependencies into a reusable base image. The change aims to improve maintainability, reduce build times through image layering, and streamline CI/CD workflows.

Changes:

  • Created a new amp-devcontainer-base image with shared dependencies (BATS testing tools, certificates, common packages)
  • Refactored C++ and Rust Dockerfiles to build from the base image instead of duplicating setup logic
  • Updated CI/CD workflows to build the base image first, then use its digest for flavor builds

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.devcontainer/base/Dockerfile Defines the new base image with common dependencies extracted from flavor-specific Dockerfiles
.devcontainer/base/apt-requirements-base.json Centralizes base package versions previously duplicated across flavor files
.devcontainer/base/devcontainer-metadata.json Provides metadata configuration for the base image
.devcontainer/cpp/Dockerfile Refactored to use base image and removed duplicated setup steps
.devcontainer/cpp/apt-requirements-base.json Cleaned up to only include C++-specific packages
.devcontainer/cpp/devcontainer.json Added build configuration to use locally-built base image
.devcontainer/rust/Dockerfile Refactored to use base image and removed duplicated setup steps
.devcontainer/rust/apt-requirements-base.json Cleaned up to only include Rust-specific packages
.devcontainer/rust/devcontainer.json Added build configuration to use locally-built base image
.github/workflows/wc-build-push.yml Added support for build arguments and version output
.github/workflows/wc-build-push-test.yml Reordered inputs alphabetically and added build-args support
.github/workflows/continuous-integration.yml Added base image build job and wired outputs to flavor builds
.github/workflows/release-build.yml Added base image build job and updated release notes generation
.github/RELEASE_TEMPLATE.md Added base image to container table
README.md Added documentation for the new base image

"unzip": "6.0-28ubuntu4.1",
"wget": "1.21.4-1ubuntu4.1",
"xsltproc": "1.1.39-0exp1ubuntu0.24.04.3",
"xz-utils": "5.6.1+really5.4.5-1ubuntu0.2"
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The package xz-utils is now duplicated between the base image (apt-requirements-base.json) and the C++ flavor. Since it's already included in the base, it should be removed from this file to avoid duplication.

Copilot uses AI. Check for mistakes.
--mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=cache,target=/var/log,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends jq \
apt-get update \
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The apt-get update command should be combined with the package installation on the same line using && to reduce layers and ensure the cache is not stale. Currently, if line 26 changes but line 25 doesn't, a cached layer with an outdated package index could be used.

Copilot uses AI. Check for mistakes.
# Include the Cisco Umbrella PKI Root
&& wget --no-hsts -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \
&& update-ca-certificates \
apt-get update \
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The apt-get update command should be combined with the package installation on the same line using && to reduce layers and ensure the cache is not stale. Currently, if line 42 changes but line 41 doesn't, a cached layer with an outdated package index could be used.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

@github-actions
Copy link
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-base:edgeghcr.io/philips-software/amp-devcontainer-base:pr-1078

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 0 B 167.86 MB +167.86 MB (+∞) 🔼
linux/arm64 0 B 160.87 MB +160.87 MB (+∞) 🔼

@github-actions
Copy link
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 20 0 0 0.57s
✅ DOCKERFILE hadolint 3 0 0 0.69s
✅ GHERKIN gherkin-lint 6 0 0 2.48s
✅ JSON npm-package-json-lint yes no no 0.35s
✅ JSON prettier 21 4 0 0 0.54s
✅ JSON v8r 21 0 0 6.91s
✅ MARKDOWN markdownlint 11 0 0 0 1.0s
✅ MARKDOWN markdown-table-formatter 11 0 0 0 0.28s
✅ REPOSITORY checkov yes no no 17.46s
✅ REPOSITORY gitleaks yes no no 0.51s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY grype yes no no 28.45s
✅ REPOSITORY secretlint yes no no 0.9s
✅ REPOSITORY syft yes no no 1.81s
✅ REPOSITORY trivy yes no no 8.0s
✅ REPOSITORY trivy-sbom yes no no 0.23s
✅ REPOSITORY trufflehog yes no no 2.26s
✅ SPELL lychee 79 0 0 21.46s
✅ YAML prettier 28 0 0 0 0.96s
✅ YAML v8r 28 0 0 8.04s
✅ YAML yamllint 28 0 0 0.86s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.3.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,DOCKERFILE_HADOLINT,GHERKIN_GHERKIN_LINT,JSON_V8R,JSON_PRETTIER,JSON_NPM_PACKAGE_JSON_LINT,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security

Copy link
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

"forwardPorts": [
6080
],

@github-actions
Copy link
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-cpp:edgeghcr.io/philips-software/amp-devcontainer-cpp:pr-1078

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 683.37 MB 683.86 MB +486.98 kB (+0.07%) 🔼
linux/arm64 665.29 MB 665.78 MB +491.91 kB (+0.07%) 🔼

@github-actions
Copy link
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-rust:edgeghcr.io/philips-software/amp-devcontainer-rust:pr-1078

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 548.17 MB 565.39 MB +17.21 MB (+3.14%) 🔼
linux/arm64 502.9 MB 502.98 MB +74.56 kB (+0.01%) 🔼

@github-actions
Copy link
Contributor

Test Results

 5 files  ±0   5 suites  ±0   5m 46s ⏱️ + 2m 22s
32 tests ±0  29 ✅  - 3  0 💤 ±0  3 ❌ +3 
67 runs  ±0  61 ✅  - 6  0 💤 ±0  6 ❌ +6 

For more details on these failures, see this check.

Results for commit be5f51c. ± Comparison against base commit 5ec2927.


# Install the base system with all tool dependencies
# hadolint ignore=DL3008
RUN --mount=type=bind,source=.devcontainer/base/apt-requirements-base.json,target=/tmp/apt-requirements-base.json \
Copy link
Member

Choose a reason for hiding this comment

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

I never used this mount approach for RUNs. How does this play with build step caching, does a change in the input file still ensure the RUN is rerun?

ARG INCLUDE_WHAT_YOU_USE_VERSION=0.23
ARG XWIN_VERSION=0.6.7

ARG AMP_DEVCONTAINER_VERSION=local
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it safer to use unknown here as well?

ARG CARGO_BINSTALL_VERSION=1.15.11
ARG RUST_VERSION=1.91.1

ARG AMP_DEVCONTAINER_VERSION=local
Copy link
Member

Choose a reason for hiding this comment

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

Same applies here

Comment on lines +8 to +12
description: "Path to the Playwright acceptance tests (directory that contains playwright.config.ts)"
required: false
type: string
build-args:
description: "Optional docker build args (newline-separated KEY=VALUE)"
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick] Quotes for description not required here. I see the file already had more of these so i'll leave it up to you

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.

3 participants