Browse code

Merge pull request #18939 from dnephin/dont_use_parse_from_builder

Remove the need for runconfig.Parse() in the builder

Vincent Demeester authored on 2015/12/29 02:47:05
Showing 1 changed files
... ...
@@ -9,7 +9,6 @@ package dockerfile
9 9
 
10 10
 import (
11 11
 	"fmt"
12
-	"io/ioutil"
13 12
 	"os"
14 13
 	"path/filepath"
15 14
 	"regexp"
... ...
@@ -18,10 +17,10 @@ import (
18 18
 	"strings"
19 19
 
20 20
 	"github.com/Sirupsen/logrus"
21
+	"github.com/docker/docker/api/types/container"
21 22
 	"github.com/docker/docker/api/types/strslice"
22 23
 	"github.com/docker/docker/builder"
23 24
 	derr "github.com/docker/docker/errors"
24
-	flag "github.com/docker/docker/pkg/mflag"
25 25
 	"github.com/docker/docker/pkg/signal"
26 26
 	"github.com/docker/docker/pkg/system"
27 27
 	"github.com/docker/docker/runconfig"
... ...
@@ -315,13 +314,9 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
315 315
 		}
316 316
 	}
317 317
 
318
-	runCmd := flag.NewFlagSet("run", flag.ContinueOnError)
319
-	runCmd.SetOutput(ioutil.Discard)
320
-	runCmd.Usage = nil
321
-
322
-	config, _, _, err := runconfig.Parse(runCmd, append([]string{b.image}, args...))
323
-	if err != nil {
324
-		return err
318
+	config := &container.Config{
319
+		Cmd:   strslice.New(args...),
320
+		Image: b.image,
325 321
 	}
326 322
 
327 323
 	// stash the cmd