diff --git a/builder/dockerfile/dispatchers.go b/builder/dockerfile/dispatchers.go index 03849fcc94..feb91ccf76 100644 --- a/builder/dockerfile/dispatchers.go +++ b/builder/dockerfile/dispatchers.go @@ -9,7 +9,6 @@ package dockerfile import ( "fmt" - "io/ioutil" "os" "path/filepath" "regexp" @@ -18,10 +17,10 @@ import ( "strings" "github.com/Sirupsen/logrus" + "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/strslice" "github.com/docker/docker/builder" derr "github.com/docker/docker/errors" - flag "github.com/docker/docker/pkg/mflag" "github.com/docker/docker/pkg/signal" "github.com/docker/docker/pkg/system" "github.com/docker/docker/runconfig" @@ -315,13 +314,9 @@ func run(b *Builder, args []string, attributes map[string]bool, original string) } } - runCmd := flag.NewFlagSet("run", flag.ContinueOnError) - runCmd.SetOutput(ioutil.Discard) - runCmd.Usage = nil - - config, _, _, err := runconfig.Parse(runCmd, append([]string{b.image}, args...)) - if err != nil { - return err + config := &container.Config{ + Cmd: strslice.New(args...), + Image: b.image, } // stash the cmd