From 6548835db52eaa6c0ac61a1bfc1c2d1e7b3b2548 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 16 Apr 2018 14:21:37 -0700 Subject: [PATCH] skip maintainer command --- integration_tests/dockerfiles/Dockerfile_test_run_2 | 1 + pkg/commands/commands.go | 4 ++++ pkg/executor/executor.go | 3 +++ 3 files changed, 8 insertions(+) diff --git a/integration_tests/dockerfiles/Dockerfile_test_run_2 b/integration_tests/dockerfiles/Dockerfile_test_run_2 index b77ea9ea0..af279464a 100644 --- a/integration_tests/dockerfiles/Dockerfile_test_run_2 +++ b/integration_tests/dockerfiles/Dockerfile_test_run_2 @@ -17,3 +17,4 @@ FROM gcr.io/google-appengine/debian9 RUN echo "hey" +MAINTAINER kaniko diff --git a/pkg/commands/commands.go b/pkg/commands/commands.go index f2dd30fb2..dd2de8a8a 100644 --- a/pkg/commands/commands.go +++ b/pkg/commands/commands.go @@ -20,6 +20,7 @@ import ( "github.com/containers/image/manifest" "github.com/docker/docker/builder/dockerfile/instructions" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) type DockerCommand interface { @@ -60,6 +61,9 @@ func GetCommand(cmd instructions.Command, buildcontext string) (DockerCommand, e return &OnBuildCommand{cmd: c}, nil case *instructions.VolumeCommand: return &VolumeCommand{cmd: c}, nil + case *instructions.MaintainerCommand: + logrus.Warnf("%s is deprecated, skipping", cmd.Name()) + return nil, nil } return nil, errors.Errorf("%s is not a supported command", cmd.Name()) } diff --git a/pkg/executor/executor.go b/pkg/executor/executor.go index 42de6c7f5..0e9288808 100644 --- a/pkg/executor/executor.go +++ b/pkg/executor/executor.go @@ -85,6 +85,9 @@ func DoBuild(dockerfilePath, srcContext, destination, snapshotMode string) error if err != nil { return err } + if dockerCommand == nil { + continue + } if err := dockerCommand.ExecuteCommand(imageConfig); err != nil { return err }