Skip to content
Permalink
Browse files
fix(build): multi-stage does not work properly with build args
  • Loading branch information
alexey-igrychev committed Jan 27, 2022
1 parent 5d5f144 commit 2b59c76140b714ce3a87ff8fa0a7593e5a2d1097
Showing with 6 additions and 6 deletions.
  1. +6 −6 pkg/build/stage/dockerfile.go
@@ -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

0 comments on commit 2b59c76

Please sign in to comment.