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:
parent
3b4a1c54d8
commit
f00e643576
4 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
13
daemon/execdriver/native/driver_unsupported.go
Normal file
13
daemon/execdriver/native/driver_unsupported.go
Normal 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")
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
// +build linux
|
||||
|
||||
package native
|
||||
|
||||
import (
|
||||
|
|
Loading…
Add table
Reference in a new issue