feat: extract common base image#1078
Conversation
There was a problem hiding this comment.
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-baseimage 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 |
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
✅MegaLinter analysis: Success
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
|
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
📦 Container Size AnalysisNote Comparing 📈 Size Comparison Table
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.devcontainer/base/apt-requirements.json:1
- The 'rustup' package should not be in the base image requirements. It was removed in this diff, which is correct, but this comment highlights that the removal is fixing an issue where rustup was incorrectly placed in the base image instead of the Rust-specific image.
{
|
Pull Request Report (#1078)Static measures
Time related measures
Status check related measures
|
|
🎉 Hooray! The changes in this pull request went live with the release of v6.7.0 🎉 |




🚀 Hey, I have created a Pull Request
Description of changes
This pull request introduces a new "base" devcontainer image to serve as a foundational layer for language-specific devcontainers (
cpp,rust), and refactors the build, test, and release workflows to leverage this shared base image. The changes aim to reduce duplication, improve maintainability, and streamline the CI/CD process for all container flavors.Key changes include:
Introduction of a Shared Base Devcontainer
.devcontainer/base/Dockerfileand associateddevcontainer.jsonto define a minimal, reusable base image with common dependencies and tooling for all flavors. (.devcontainer/base/Dockerfile,.devcontainer/base/devcontainer.json) [1] [2]apt-requirements.jsonfor the base image and moved shared package definitions from flavor-specific files. (.devcontainer/base/apt-requirements.json,.devcontainer/rust/apt-requirements.json,.devcontainer/cpp/apt-requirements-base.json) [1] [2] [3]Refactoring of Language-Specific Devcontainers
cppandrustdevcontainers to use the new base image via theBASE_IMAGEbuild argument, simplifying their Dockerfiles and removing duplicated setup steps (e.g., BATS installation, CA certificates). (.devcontainer/cpp/Dockerfile,.devcontainer/rust/Dockerfile) [1] [2]devcontainer.jsonfiles to build the base image locally when needed and to pass the correctBASE_IMAGEargument. (.devcontainer/cpp/devcontainer.json,.devcontainer/rust/devcontainer.json) [1] [2]CI/CD Workflow Improvements
continuous-integration.yml,release-build.yml,update-dependencies.yml) to build, push, and test the base image first, then use it as the foundation for building and testing the language-specific images. This ensures consistency and reduces redundant work. [1] [2] [3] [4] [5] [6] [7] [8] [9].github/RELEASE_TEMPLATE.md,.devcontainer/devcontainer.json) [1] [2]These changes make the devcontainer setup more modular and maintainable, and ensure that updates to shared dependencies or configuration are propagated consistently across all flavors.
✔️ Checklist