Fix exec driver flag, rename new driver to 'native'

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby
2014-02-24 20:41:09 -08:00
parent 27a43692c2
commit d59c05a37c
6 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ func main() {
flDefaultIp = flag.String([]string{"#ip", "-ip"}, "0.0.0.0", "Default IP address to use when binding container ports")
flInterContainerComm = flag.Bool([]string{"#icc", "-icc"}, true, "Enable inter-container communication")
flGraphDriver = flag.String([]string{"s", "-storage-driver"}, "", "Force the docker runtime to use a specific storage driver")
flExecDriver = flag.String([]string{"e", "-exec-driver"}, "", "Force the docker runtime to use a specific exec driver")
flExecDriver = flag.String([]string{"e", "-exec-driver"}, "native", "Force the docker runtime to use a specific exec driver")
flHosts = opts.NewListOpts(api.ValidateHost)
flMtu = flag.Int([]string{"#mtu", "-mtu"}, 0, "Set the containers network MTU; if no value is provided: default to the default route MTU or 1500 if no default route is available")
)
@@ -1,4 +1,4 @@
package docker
package native
import (
"github.com/dotcloud/docker/pkg/cgroups"
@@ -1,4 +1,4 @@
package docker
package native
import (
"encoding/json"
@@ -1,4 +1,4 @@
package docker
package native
import (
"github.com/dotcloud/docker/execdriver"
+11 -10
View File
@@ -7,8 +7,8 @@ import (
"github.com/dotcloud/docker/dockerversion"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/execdriver"
"github.com/dotcloud/docker/execdriver/docker"
"github.com/dotcloud/docker/execdriver/lxc"
"github.com/dotcloud/docker/execdriver/native"
"github.com/dotcloud/docker/graphdriver"
"github.com/dotcloud/docker/graphdriver/aufs"
_ "github.com/dotcloud/docker/graphdriver/btrfs"
@@ -702,17 +702,18 @@ func NewRuntimeFromDirectory(config *DaemonConfig, eng *engine.Engine) (*Runtime
sysInitPath = localCopy
}
sysInfo := sysinfo.New(false)
var (
ed execdriver.Driver
sysInfo = sysinfo.New(false)
)
var ed execdriver.Driver
utils.Debugf("execDriver: provided %s", config.ExecDriver)
if config.ExecDriver == "chroot" && false {
// chroot is presently a noop driver https://github.com/dotcloud/docker/pull/4189#issuecomment-35330655
ed, err = chroot.NewDriver()
utils.Debugf("execDriver: using chroot")
} else {
switch config.ExecDriver {
case "lxc":
ed, err = lxc.NewDriver(config.Root, sysInfo.AppArmor)
utils.Debugf("execDriver: using lxc")
case "native":
ed, err = native.NewDriver(config.Root)
default:
return nil, fmt.Errorf("unknow exec driver %s", config.ExecDriver)
}
if err != nil {
return nil, err
+1
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"github.com/dotcloud/docker/execdriver"
_ "github.com/dotcloud/docker/execdriver/lxc"
_ "github.com/dotcloud/docker/execdriver/native"
"io"
"io/ioutil"
"log"