Browse Source

Merge pull request #18939 from dnephin/dont_use_parse_from_builder

Remove the need for runconfig.Parse() in the builder
Vincent Demeester 9 years ago
parent
commit
ad56c972b4
1 changed files with 4 additions and 9 deletions
  1. 4 9
      builder/dockerfile/dispatchers.go

+ 4 - 9
builder/dockerfile/dispatchers.go

@@ -9,7 +9,6 @@ package dockerfile
 
 
 import (
 import (
 	"fmt"
 	"fmt"
-	"io/ioutil"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
 	"regexp"
 	"regexp"
@@ -18,10 +17,10 @@ import (
 	"strings"
 	"strings"
 
 
 	"github.com/Sirupsen/logrus"
 	"github.com/Sirupsen/logrus"
+	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/strslice"
 	"github.com/docker/docker/api/types/strslice"
 	"github.com/docker/docker/builder"
 	"github.com/docker/docker/builder"
 	derr "github.com/docker/docker/errors"
 	derr "github.com/docker/docker/errors"
-	flag "github.com/docker/docker/pkg/mflag"
 	"github.com/docker/docker/pkg/signal"
 	"github.com/docker/docker/pkg/signal"
 	"github.com/docker/docker/pkg/system"
 	"github.com/docker/docker/pkg/system"
 	"github.com/docker/docker/runconfig"
 	"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
 	// stash the cmd