mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-17 23:25:32 +02:00
Resolve env replacement for FROM command
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
FROM scratch
|
||||
ARG image
|
||||
FROM ${image}
|
||||
# First, make sure simple arg replacement works
|
||||
ARG file
|
||||
COPY $file /foo
|
||||
|
||||
@@ -98,6 +98,7 @@ func TestRun(t *testing.T) {
|
||||
"Dockerfile_test_add": {"file=context/foo"},
|
||||
"Dockerfile_test_onbuild": {"file=/tmp/onbuild"},
|
||||
"Dockerfile_test_scratch": {
|
||||
"image=scratch",
|
||||
"hello=hello-value",
|
||||
"file=context/foo",
|
||||
"file3=context/b*",
|
||||
|
||||
@@ -63,7 +63,10 @@ func DoBuild(dockerfilePath, srcContext, snapshotMode string, args []string) (na
|
||||
return nil, nil, err
|
||||
}
|
||||
for index, stage := range stages {
|
||||
baseImage := stage.BaseName
|
||||
baseImage, err := util.ResolveEnvironmentReplacement(stage.BaseName, args, false)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
finalStage := index == len(stages)-1
|
||||
// Unpack file system to root
|
||||
logrus.Infof("Unpacking filesystem of %s...", baseImage)
|
||||
|
||||
Reference in New Issue
Block a user