Skip to content

Commit a73b5ca

Browse files
Minor cleanup.
1 parent e7c167f commit a73b5ca

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/docker-tag.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
# Collect all image references from COPY --from= and FROM directives
5050
mapfile -t ALL_REFS < <({
5151
sed -n 's/.*--from=\([^ ]*\).*/\1/p' Dockerfile
52+
# Skip FROM options like `--platform` to capture the image reference
5253
awk '/^FROM/ {
5354
for (i = 2; i <= NF; i++) {
5455
if ($i !~ /^--/) { print $i; break }

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,11 @@ RUN <<-EOT
102102
/usr/lib/jvm/graalvm*/lib/installer
103103
EOT
104104

105-
FROM --platform=linux/amd64 azul/zulu-openjdk:7 AS zulu7-amd64
106-
FROM --platform=linux/amd64 ibmjava:8-sdk AS ibm8-amd64
107-
108105
FROM all-jdk-common AS all-jdk-arm64
109106

107+
FROM --platform=linux/amd64 azul/zulu-openjdk:7 AS zulu7-amd64
108+
FROM --platform=linux/amd64 ibmjava:8-sdk AS ibm8-amd64
110109
FROM all-jdk-common AS all-jdk-amd64
111-
112110
COPY --from=zulu7-amd64 /usr/lib/jvm/zulu7 /usr/lib/jvm/7
113111
COPY --from=ibm8-amd64 /opt/ibm/java /usr/lib/jvm/ibm8
114112

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ Image variants are available on a per JDK basis:
1111
- The `zulu8`, `zulu11`, `oracle8`, `ibm8`, `semeru8`, `semeru11`, `semeru17`, `graalvm17`, `graalvm21`, and `graalvm25` variants each contain the base JDKs in addition to the specific JDK from their name.
1212
- The `latest` variant contains the base JDKs and all of the specific JDKs above.
1313

14-
All variants are published as multi-arch manifests covering `linux/amd64` and `linux/arm64`, so the same tag (e.g. `base`, `zulu8`, `tip`) resolves to the correct image for the host architecture. The `7` and `ibm8` variants are amd64-only because the upstream JDK images are not available for arm64; `docker pull` for those tags on arm64 will fail.
15-
16-
Images are tagged with `ci-` prefixes via the [Tag new images version](https://github.com/DataDog/dd-trace-java-docker-build/actions/workflows/docker-tag.yml) workflow, which runs quarterly on `master` and when manually triggered. A **48-hour cooldown** is enforced: the workflow verifies that all external upstream dependencies (Eclipse Temurin, Azul Zulu, IBM Semeru, GraalVM, etc.) referenced in the Dockerfile were built at least 48 hours ago before tagging. This ensures that upstream images have had sufficient time for vulnerability scans and community review before being CI use. On completion, it automatically triggers the [Update mirror digests for ci-* images](https://github.com/DataDog/dd-trace-java-docker-build/actions/workflows/update-mirror-digests.yml) workflow, which opens a PR in [DataDog/images](https://github.com/DataDog/images) updating the pinned `ci-*` mirror image digests. Once that PR is merged, `dd-trace-java` CI picks up the updated images from `registry.ddbuild.io`. Images are mirrored in `registry.ddbuild.io` to ensure they are signed before use in CI.
14+
All variants are published as multi-arch manifests covering `linux/amd64` and `linux/arm64`, so the same tag (e.g. `base`, `zulu8`, `tip`) resolves to the correct image for the host architecture.
15+
The `7` and `ibm8` variants are amd64-only because the upstream JDK images are not available for arm64;
16+
`docker pull` for those tags on arm64 will fail.
17+
18+
Images are tagged with `ci-` prefixes via the [Tag new images version](https://github.com/DataDog/dd-trace-java-docker-build/actions/workflows/docker-tag.yml) workflow, which runs quarterly on `master` and when manually triggered.
19+
A **48-hour cooldown** is enforced: the workflow verifies that all external upstream dependencies (Eclipse Temurin, Azul Zulu, IBM Semeru, GraalVM, etc.) referenced in the Dockerfile were built at least 48 hours ago before tagging.
20+
This ensures that upstream images have had sufficient time for vulnerability scans and community review before being CI use. On completion, it automatically triggers the [Update mirror digests for ci-* images](https://github.com/DataDog/dd-trace-java-docker-build/actions/workflows/update-mirror-digests.yml) workflow,
21+
which opens a PR in [DataDog/images](https://github.com/DataDog/images) updating the pinned `ci-*` mirror image digests.
22+
Once that PR is merged, `dd-trace-java` CI picks up the updated images from `registry.ddbuild.io`. Images are mirrored in `registry.ddbuild.io` to ensure they are signed before use in CI.
1723

1824
## Development
1925

build

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ function compute_metadata() {
7878
GIT_HEAD_REF="$(git show-ref --head --hash ^HEAD)"
7979
}
8080

81-
# docker buildx wrapper for local single-platform builds. Uses --load so the
82-
# resulting image is available in the local docker daemon for testing. Uses
83-
# buildx (not plain `docker build`) so the buildx builder cache is shared with
81+
# docker buildx wrapper for local single-platform builds.
82+
# Uses --load so the resulting image is available in the local docker daemon for testing.
83+
# Uses buildx (not plain `docker build`) so the buildx builder cache is shared with
8484
# the later push-by-digest step.
8585
# See https://github.com/opencontainers/image-spec/blob/main/annotations.md for common labels
8686
# See https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package
@@ -108,6 +108,7 @@ function docker_build() {
108108
# docker buildx wrapper that pushes the image by digest only (no tag) and writes
109109
# the resulting manifest digest to a metadata file. The merge step consumes
110110
# these files to assemble the multi-arch manifest list.
111+
# Avoid orphan attestation manifests from temporary digest-only pushes: `--provenance=false --sbom=false`.
111112
function buildx_push_by_digest() {
112113
local target="$1"
113114
local variant="$2"
@@ -122,6 +123,8 @@ function buildx_push_by_digest() {
122123
--label org.opencontainers.image.source=https://github.com/DataDog/dd-trace-java-docker-build \
123124
--label org.opencontainers.image.revision="$GIT_HEAD_REF" \
124125
--target "$target" \
126+
--provenance=false \
127+
--sbom=false \
125128
--output "type=image,name=${IMAGE_NAME},push-by-digest=true,name-canonical=true,push=true" \
126129
--metadata-file "${DIGESTS_DIR}/${ARCH}-${variant}.json" \
127130
"$@" \

0 commit comments

Comments
 (0)