Skip to content

Base image build process#7270

Draft
nccatoni wants to merge 7 commits into
mainfrom
nccatoni/base-image-build
Draft

Base image build process#7270
nccatoni wants to merge 7 commits into
mainfrom
nccatoni/base-image-build

Conversation

@nccatoni

@nccatoni nccatoni commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

nccatoni added 2 commits July 6, 2026 17:33
Base images will now be tagged with a content hash appended by
utils/scripts/build_base_images.py.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

utils/build/docker/php/weblog_metadata.yml                              @DataDog/apm-php @DataDog/system-tests-core
utils/scripts/build_base_images.py                                      @DataDog/system-tests-core
.gitlab-ci.yml                                                          @DataDog/system-tests-core
docs/understand/weblogs/weblog-metadata.md                              @DataDog/system-tests-core
utils/_context/weblog_metadata.py                                       @DataDog/system-tests-core
utils/build/docker/nodejs/docker-bake.hcl                               @DataDog/dd-trace-js @DataDog/system-tests-core
utils/build/docker/nodejs/weblog_metadata.yml                           @DataDog/dd-trace-js @DataDog/system-tests-core
utils/build/docker/php/docker-bake.hcl                                  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/php-fpm/build.sh                                 @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/python/docker-bake.hcl                               @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/weblog_metadata.yml                           @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/ci/gitlab/main.yml                                                @DataDog/system-tests-core

Adds build_base_images.py, which for every docker-bake.hcl target listed
under base_image_dependencies in a library's weblog_metadata.yml, hashes
the target's bake config, Dockerfile, and declared dependencies, and
pushes the base image to Docker Hub tagged with that hash if missing.

Wires it up as a build_base_images job in .gitlab-ci.yml, running on
every push. It is idempotent: existing tags are never overwritten, so
it is safe to run ahead of merge.
@nccatoni nccatoni force-pushed the nccatoni/base-image-build branch from a750a56 to e2c8ca6 Compare July 6, 2026 16:24
@nccatoni nccatoni force-pushed the nccatoni/base-image-build branch from e2c8ca6 to 611f535 Compare July 6, 2026 16:25
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 6, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0797a09 | Docs | Datadog PR Page | Give us feedback!

Previously image_exists() silently treated any docker manifest inspect
failure as "tag doesn't exist", masking real errors (auth, network).
Print stderr on failure there, and in a new _run() helper used by the
other docker/git subprocess calls, so failures are visible instead of
only raising a bare CalledProcessError.
@nccatoni nccatoni force-pushed the nccatoni/base-image-build branch from f25de84 to 0beb187 Compare July 6, 2026 18:03
composer install failed for php-fpm targets because stripe/stripe-php
requires ext-mbstring, which wasn't installed. apache-mod targets were
unaffected since they use the official PHP image, which bundles it.
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.

1 participant