Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize build args from stage base #5048

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

daghack
Copy link
Collaborator

@daghack daghack commented Jun 17, 2024

Currently, when we initialize a new dispatchState, buildArgs are not carried forward from the base.
This causes a subtle issue while linting where a Dockerfile such as

FROM alpine AS declared
ARG foo
COPY $foo .

FROM declared AS dependent
COPY $foo .

Will erroneously emit a UndeclaredVariable linting warning for the occurrence of $foo in the dependent stage.

This updates dispatchState to initialize buildArgs from its base.

Signed-off-by: Talon Bowler <talon.bowler@docker.com>
@daghack daghack force-pushed the initialze-buildargs-from-base branch 3 times, most recently from 85ae23e to dadc45d Compare June 17, 2024 20:30
Signed-off-by: Talon Bowler <talon.bowler@docker.com>
@daghack daghack force-pushed the initialze-buildargs-from-base branch from dadc45d to c7c2f0e Compare June 17, 2024 20:30
@daghack daghack marked this pull request as ready for review June 17, 2024 20:39
@daghack daghack requested a review from tonistiigi June 17, 2024 21:57
@tonistiigi tonistiigi merged commit f1d1e99 into moby:master Jun 18, 2024
76 checks passed
@daghack daghack deleted the initialze-buildargs-from-base branch June 24, 2024 15:47
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.

None yet

2 participants