1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #18939 from dnephin/dont_use_parse_from_builder

Remove the need for runconfig.Parse() in the builder
This commit is contained in:
Vincent Demeester 2015-12-28 18:47:05 +01:00
commit ad56c972b4

View file

@ -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