Skip to content

fix: promote multi-stage build args to ENV so they propagate across stages#90

Merged
maxim-voronko merged 1 commit into
developmentfrom
fix_cross_stage_arg_propagation
Jul 6, 2026
Merged

fix: promote multi-stage build args to ENV so they propagate across stages#90
maxim-voronko merged 1 commit into
developmentfrom
fix_cross_stage_arg_propagation

Conversation

@maxim-voronko

@maxim-voronko maxim-voronko commented Jun 26, 2026

Copy link
Copy Markdown
Member

Build args declared in the wpr_dependencies stage (WPR_FILES_DIR, WPR_APP_INSTALL_DIR, WPR_USER_NAME) did not reach the later wpr_installer and wpr_service stages. An ARG goes out of scope at the end of the stage where it is declared, so in the child stages these variables resolved to empty.

This reproduces on build engines that do not inherit parent-stage ARG defaults (Kaniko, buildah, classic builder)

The fix promotes these three to ENV in the base stage. Unlike ARG, ENV is inherited across FROM, so the values reach all stages on any build engine, without redeclaring each ARG per stage. Applied to both Dockerfile and Dockerfile.redhat. Dockerfile.ubuntu-prebuilt already declares its args per stage and was not affected.

@maxim-voronko maxim-voronko changed the title fix: promote multi-stage build args to ENV so they propagate across s… fix: promote multi-stage build args to ENV so they propagate across stages Jun 26, 2026
@maxim-voronko maxim-voronko merged commit 4fb7da3 into development Jul 6, 2026
@maxim-voronko maxim-voronko deleted the fix_cross_stage_arg_propagation branch July 6, 2026 14:04
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.

3 participants