Update native driver for libcontainer changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael) Upstream-commit: f00e64357672ea3a130b2570ce34ea48ad51bbb5 Component: engine
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
// +build linux
|
||||
|
||||
package native
|
||||
|
||||
import (
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
// +build linux
|
||||
|
||||
package native
|
||||
|
||||
import (
|
||||
@ -16,6 +18,7 @@ import (
|
||||
"github.com/docker/libcontainer/cgroups/fs"
|
||||
"github.com/docker/libcontainer/cgroups/systemd"
|
||||
"github.com/docker/libcontainer/namespaces"
|
||||
"github.com/docker/libcontainer/syncpipe"
|
||||
"github.com/dotcloud/docker/daemon/execdriver"
|
||||
"github.com/dotcloud/docker/pkg/system"
|
||||
)
|
||||
@ -32,6 +35,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(f).Decode(&container); err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
@ -42,13 +46,16 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
syncPipe, err := namespaces.NewSyncPipeFromFd(0, uintptr(args.Pipe))
|
||||
|
||||
syncPipe, err := syncpipe.NewSyncPipeFromFd(0, uintptr(args.Pipe))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := namespaces.Init(container, rootfs, args.Console, syncPipe, args.Args); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@ -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")
|
||||
}
|
||||
@ -1,3 +1,5 @@
|
||||
// +build linux
|
||||
|
||||
package native
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user