Skip to content

Commit

Permalink
fix(build): multi-stage does not work properly with build args
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-igrychev committed Jan 27, 2022
1 parent 5d5f144 commit 2b59c76
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 2b59c76

Please sign in to comment.