Skip to content

Keep default for repeated arg in multistage builds - #1910

Merged
rohanKanojia merged 2 commits into
fabric8io:masterfrom
vckleinew:keepArgDefaultInMultiStageBuild
Mar 25, 2026
Merged

rohanKanojia merged 2 commits into
fabric8io:masterfrom
vckleinew:keepArgDefaultInMultiStageBuild

Conversation

@vckleinew

@vckleinew vckleinew commented Mar 20, 2026 •

Copy link
Copy Markdown

Using ARG repeatedly in multistage build does not keep default values. For example running docker:build on

ARG BASE_IMAGE=ubuntu:noble

FROM ${BASE_IMAGE} AS builder
ARG BASE_IMAGE
RUN echo builder

FROM ${BASE_IMAGE}
ARG BASE_IMAGE
RUN echo final

results in

Execution default-cli of goal io.fabric8:docker-maven-plugin:0.48.1:build failed: is not a proper image name ([registry/][repo][:port]

because the default for BASE_IMAGE is lost. Use case for repeated ARG for example is adding labels to the generated final image.

This is probably also the cause for issue #1573

Signed-off-by: Christian Kleinewaechter <christian.kleinewaechter@vitroconnect.de>
@vckleinew

vckleinew commented Mar 23, 2026 •

Copy link
Copy Markdown
Author

The E2E test failures seem to be unrelated to this PR and seem to be caused by failure of ttl.sh with this image name. Changing the name in the test make it work. This failure also occurs in other PRs like #1908, see for example https://github.com/fabric8io/docker-maven-plugin/actions/runs/22889132708/job/67123930078?pr=1908#step:6:1037

This failure seems to be due to some corruption on ttl.sh with exactly this image name and tag combination. changing the ttl to 30m works.

@sonarqubecloud

Copy link
Copy Markdown

@vckleinew

Copy link
Copy Markdown
Author

The remaining E2E failure on MacOS V27 looks also unrelated to me. The MacOS tests take much longer, maybe in this environment the 10s timeout for postgres startup in it-properties is to tight.

@rohanKanojia
rohanKanojia merged commit b76752e into fabric8io:master Mar 25, 2026
25 of 26 checks passed
@vckleinew
vckleinew deleted the keepArgDefaultInMultiStageBuild branch March 25, 2026 09:16
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