Skip to content

STAC-24657: resolve base image via ARG BASE_IMAGE#14

Merged
viliakov merged 1 commit into
mainfrom
STAC-24657-base-image-arg
Jun 9, 2026
Merged

STAC-24657: resolve base image via ARG BASE_IMAGE#14
viliakov merged 1 commit into
mainfrom
STAC-24657-base-image-arg

Conversation

@viliakov

@viliakov viliakov commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Simplify base image resolution in the apply-oci-labels composite to rely on a single well-known declaration in the Dockerfile: ARG BASE_IMAGE=<registry/name>:<tag>.

The runtime FROM in every docker-images Dockerfile is now FROM ${BASE_IMAGE} (see StackVista/docker-images#109), so we no longer need to:

  • Export every ARG NAME=VALUE declaration from the Dockerfile.
  • Grep for the last FROM line, strip --platform= / AS <stage>.
  • envsubst the ARG references to reconstruct the base reference.

Instead, the action does a single grep -E '^[[:space:]]*ARG[[:space:]]+BASE_IMAGE=', takes the first match, strips the prefix, and uses the value as org.opencontainers.image.base.name. base-digest resolution via docker buildx imagetools inspect is unchanged.

The base-name input remains an override for build systems (Family B-E) whose Dockerfile does not declare ARG BASE_IMAGE (or has no Dockerfile at all).

Changes

  • action.yml - replace FROM-parsing + ARG-export + envsubst block with a single-line ARG BASE_IMAGE= grep. Updated input descriptions.
  • testdata/Dockerfile - use ARG BASE_IMAGE=... + FROM ${BASE_IMAGE} to match the new convention.
  • apply-oci-labels-ci.yml - comment update only; the matrix and assertions are unchanged. Existing smoke matrix already covers both the Dockerfile-extraction path and the overrides path.

Compatibility

Callers that already pass explicit base-name (Family B-E) are unaffected. Callers that rely on Dockerfile extraction must declare ARG BASE_IMAGE=; the docker-images PR above completes that rollout for the first consumer.

@viliakov viliakov requested a review from a team as a code owner June 9, 2026 09:37
@viliakov viliakov merged commit 7560a59 into main Jun 9, 2026
5 checks passed
@viliakov viliakov deleted the STAC-24657-base-image-arg branch June 9, 2026 10:10
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