mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove the need for runconfig.Parse() in the builder.
By using a container.Config directly. Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
603d488a00
commit
6dba0b5d89
1 changed files with 4 additions and 9 deletions
|
@ -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)
|
config := &container.Config{
|
||||||
runCmd.SetOutput(ioutil.Discard)
|
Cmd: strslice.New(args...),
|
||||||
runCmd.Usage = nil
|
Image: b.image,
|
||||||
|
|
||||||
config, _, _, err := runconfig.Parse(runCmd, append([]string{b.image}, args...))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// stash the cmd
|
// stash the cmd
|
||||||
|
|
Loading…
Add table
Reference in a new issue