Skip to content

Commit

Permalink
Merge pull request #4104 from werf/fix_build_multi_stage
Browse files Browse the repository at this point in the history
fix(build): multi-stage does not work properly with build args
  • Loading branch information
alexey-igrychev committed Jan 27, 2022
2 parents 5d5f144 + 2b59c76 commit ece2be6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/build/stage/dockerfile.go
Expand Up @@ -268,21 +268,21 @@ type dockerfileInstructionInterface interface {
func (s *DockerfileStage) FetchDependencies(ctx context.Context, _ Conveyor, containerRuntime container_runtime.ContainerRuntime) error {
outerLoop:
for ind, stage := range s.dockerStages {
resolvedBaseName, err := s.ShlexProcessWordWithMetaArgs(stage.BaseName)
if err != nil {
return err
}

for relatedStageIndex, relatedStage := range s.dockerStages {
if ind == relatedStageIndex {
continue
}

if stage.BaseName == relatedStage.Name {
if resolvedBaseName == relatedStage.Name {
continue outerLoop
}
}

resolvedBaseName, err := s.ShlexProcessWordWithMetaArgs(stage.BaseName)
if err != nil {
return err
}

_, ok := s.imageOnBuildInstructions[resolvedBaseName]
if ok || resolvedBaseName == "scratch" {
continue
Expand Down

0 comments on commit ece2be6

Please sign in to comment.