mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Fix cross compile non cgo and linux systems
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael) Upstream-commit: 7a8ea91392e0cc97caf2a6edc3b262b33a5b446d Component: engine
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/libcontainer/label"
|
||||
"github.com/docker/libcontainer/selinux"
|
||||
"github.com/dotcloud/docker/archive"
|
||||
"github.com/dotcloud/docker/daemon/execdriver"
|
||||
"github.com/dotcloud/docker/daemon/execdriver/execdrivers"
|
||||
@@ -300,7 +299,8 @@ func (daemon *Daemon) Destroy(container *Container) error {
|
||||
if err := os.RemoveAll(container.root); err != nil {
|
||||
return fmt.Errorf("Unable to remove filesystem for %v: %v", container.ID, err)
|
||||
}
|
||||
selinux.FreeLxcContexts(container.ProcessLabel)
|
||||
|
||||
selinuxFreeLxcContexts(container.ProcessLabel)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -761,7 +761,7 @@ func NewDaemon(config *daemonconfig.Config, eng *engine.Engine) (*Daemon, error)
|
||||
|
||||
func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*Daemon, error) {
|
||||
if !config.EnableSelinuxSupport {
|
||||
selinux.SetDisabled()
|
||||
selinuxSetDisabled()
|
||||
}
|
||||
|
||||
// Create the root directory if it doesn't exists
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build linux
|
||||
// +build linux,cgo
|
||||
|
||||
package native
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build linux
|
||||
// +build linux,cgo
|
||||
|
||||
package native
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// +build linux,!cgo
|
||||
|
||||
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,4 +1,4 @@
|
||||
// +build linux
|
||||
// +build linux,cgo
|
||||
|
||||
package native
|
||||
|
||||
|
||||
13
components/engine/daemon/utils_linux.go
Normal file
13
components/engine/daemon/utils_linux.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// +build linux
|
||||
|
||||
package daemon
|
||||
|
||||
import "github.com/docker/libcontainer/selinux"
|
||||
|
||||
func selinuxSetDisabled() {
|
||||
selinux.SetDisabled()
|
||||
}
|
||||
|
||||
func selinuxFreeLxcContexts(label string) {
|
||||
selinux.FreeLxcContexts(label)
|
||||
}
|
||||
9
components/engine/daemon/utils_nolinux.go
Normal file
9
components/engine/daemon/utils_nolinux.go
Normal file
@@ -0,0 +1,9 @@
|
||||
// +build !linux
|
||||
|
||||
package daemon
|
||||
|
||||
func selinuxSetDisabled() {
|
||||
}
|
||||
|
||||
func selinuxFreeLxcContexts(label string) {
|
||||
}
|
||||
Reference in New Issue
Block a user