diff --git a/integration/dockerfiles/Dockerfile_test_cmd b/integration/dockerfiles/Dockerfile_test_cmd index 631b93fd84..a2f0162b0a 100644 --- a/integration/dockerfiles/Dockerfile_test_cmd +++ b/integration/dockerfiles/Dockerfile_test_cmd @@ -1,4 +1,4 @@ -FROM scratch AS first +FROM gcr.io/distroless/base@sha256:628939ac8bf3f49571d05c6c76b8688cb4a851af6c7088e599388259875bde20 AS first CMD ["mycmd"] FROM first diff --git a/pkg/commands/cmd.go b/pkg/commands/cmd.go index c6965c41ef..3087552002 100644 --- a/pkg/commands/cmd.go +++ b/pkg/commands/cmd.go @@ -23,7 +23,6 @@ import ( "github.com/google/go-containerregistry/pkg/v1" "github.com/moby/buildkit/frontend/dockerfile/instructions" - "github.com/sirupsen/logrus" ) type CmdCommand struct { @@ -48,7 +47,6 @@ func (c *CmdCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bui newCommand = c.cmd.CmdLine } - logrus.Infof("Replacing CMD in config with %v", newCommand) config.Cmd = newCommand config.ArgsEscaped = true return nil diff --git a/pkg/commands/entrypoint.go b/pkg/commands/entrypoint.go index ba8aa0c822..5e403e23d2 100644 --- a/pkg/commands/entrypoint.go +++ b/pkg/commands/entrypoint.go @@ -23,7 +23,6 @@ import ( "github.com/google/go-containerregistry/pkg/v1" "github.com/moby/buildkit/frontend/dockerfile/instructions" - "github.com/sirupsen/logrus" ) type EntrypointCommand struct { @@ -47,7 +46,6 @@ func (e *EntrypointCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerf newCommand = e.cmd.CmdLine } - logrus.Infof("Replacing Entrypoint in config with %v", newCommand) config.Entrypoint = newCommand return nil } diff --git a/pkg/executor/build.go b/pkg/executor/build.go index 10cbeca9e8..c9d08b7611 100644 --- a/pkg/executor/build.go +++ b/pkg/executor/build.go @@ -248,7 +248,7 @@ func reviewConfig(stage config.KanikoStage, config *v1.Config) error { } } if entrypoint && !cmd { - config.Cmd = []string{} + config.Cmd = nil } return nil } diff --git a/pkg/executor/build_test.go b/pkg/executor/build_test.go index e1f1204331..51eca6f993 100644 --- a/pkg/executor/build_test.go +++ b/pkg/executor/build_test.go @@ -50,7 +50,7 @@ func Test_reviewConfig(t *testing.T) { ENTRYPOINT ["myentrypoint"]`, originalEntrypoint: []string{"myentrypoint"}, originalCmd: []string{"mycmd"}, - expectedCmd: []string{}, + expectedCmd: nil, }, } for _, test := range tests {