Update native driver for libcontainer changes

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-07-14 12:49:50 -07:00
parent 3b4a1c54d8
commit f00e643576
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,5 @@
// +build linux
package native package native
import ( import (

View File

@ -1,3 +1,5 @@
// +build linux
package native package native
import ( import (
@ -16,6 +18,7 @@ import (
"github.com/docker/libcontainer/cgroups/fs" "github.com/docker/libcontainer/cgroups/fs"
"github.com/docker/libcontainer/cgroups/systemd" "github.com/docker/libcontainer/cgroups/systemd"
"github.com/docker/libcontainer/namespaces" "github.com/docker/libcontainer/namespaces"
"github.com/docker/libcontainer/syncpipe"
"github.com/dotcloud/docker/daemon/execdriver" "github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/pkg/system" "github.com/dotcloud/docker/pkg/system"
) )
@ -32,6 +35,7 @@ func init() {
if err != nil { if err != nil {
return err return err
} }
if err := json.NewDecoder(f).Decode(&container); err != nil { if err := json.NewDecoder(f).Decode(&container); err != nil {
f.Close() f.Close()
return err return err
@ -42,13 +46,16 @@ func init() {
if err != nil { if err != nil {
return err return err
} }
syncPipe, err := namespaces.NewSyncPipeFromFd(0, uintptr(args.Pipe))
syncPipe, err := syncpipe.NewSyncPipeFromFd(0, uintptr(args.Pipe))
if err != nil { if err != nil {
return err return err
} }
if err := namespaces.Init(container, rootfs, args.Console, syncPipe, args.Args); err != nil { if err := namespaces.Init(container, rootfs, args.Console, syncPipe, args.Args); err != nil {
return err return err
} }
return nil return nil
}) })
} }

View File

@ -0,0 +1,13 @@
// +build !linux
package native
import (
"fmt"
"github.com/dotcloud/docker/daemon/execdriver"
)
func NewDriver(root, initPath string) (execdriver.Driver, error) {
return nil, fmt.Errorf("native driver not supported on non-linux")
}

View File

@ -1,3 +1,5 @@
// +build linux
package native package native
import ( import (