| ... | ... |
@@ -13,7 +13,6 @@ import ( |
| 13 | 13 |
"time" |
| 14 | 14 |
|
| 15 | 15 |
"github.com/docker/libcontainer/label" |
| 16 |
- "github.com/docker/libcontainer/selinux" |
|
| 17 | 16 |
"github.com/dotcloud/docker/archive" |
| 18 | 17 |
"github.com/dotcloud/docker/daemon/execdriver" |
| 19 | 18 |
"github.com/dotcloud/docker/daemon/execdriver/execdrivers" |
| ... | ... |
@@ -300,7 +299,8 @@ func (daemon *Daemon) Destroy(container *Container) error {
|
| 300 | 300 |
if err := os.RemoveAll(container.root); err != nil {
|
| 301 | 301 |
return fmt.Errorf("Unable to remove filesystem for %v: %v", container.ID, err)
|
| 302 | 302 |
} |
| 303 |
- selinux.FreeLxcContexts(container.ProcessLabel) |
|
| 303 |
+ |
|
| 304 |
+ selinuxFreeLxcContexts(container.ProcessLabel) |
|
| 304 | 305 |
|
| 305 | 306 |
return nil |
| 306 | 307 |
} |
| ... | ... |
@@ -761,7 +761,7 @@ func NewDaemon(config *daemonconfig.Config, eng *engine.Engine) (*Daemon, error) |
| 761 | 761 |
|
| 762 | 762 |
func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*Daemon, error) {
|
| 763 | 763 |
if !config.EnableSelinuxSupport {
|
| 764 |
- selinux.SetDisabled() |
|
| 764 |
+ selinuxSetDisabled() |
|
| 765 | 765 |
} |
| 766 | 766 |
|
| 767 | 767 |
// Create the root directory if it doesn't exists |
| 5 | 5 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,13 @@ |
| 0 |
+// +build linux,!cgo |
|
| 1 |
+ |
|
| 2 |
+package native |
|
| 3 |
+ |
|
| 4 |
+import ( |
|
| 5 |
+ "fmt" |
|
| 6 |
+ |
|
| 7 |
+ "github.com/dotcloud/docker/daemon/execdriver" |
|
| 8 |
+) |
|
| 9 |
+ |
|
| 10 |
+func NewDriver(root, initPath string) (execdriver.Driver, error) {
|
|
| 11 |
+ return nil, fmt.Errorf("native driver not supported on non-linux")
|
|
| 12 |
+} |
| 5 | 5 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,13 @@ |
| 0 |
+// +build linux |
|
| 1 |
+ |
|
| 2 |
+package daemon |
|
| 3 |
+ |
|
| 4 |
+import "github.com/docker/libcontainer/selinux" |
|
| 5 |
+ |
|
| 6 |
+func selinuxSetDisabled() {
|
|
| 7 |
+ selinux.SetDisabled() |
|
| 8 |
+} |
|
| 9 |
+ |
|
| 10 |
+func selinuxFreeLxcContexts(label string) {
|
|
| 11 |
+ selinux.FreeLxcContexts(label) |
|
| 12 |
+} |