summaryrefslogtreecommitdiff
path: root/daemon/container_windows.go
diff options
context:
space:
mode:
authorJohn Howard <jhoward@microsoft.com>2015-09-18 18:21:57 -0700
committerJohn Howard <jhoward@microsoft.com>2015-10-29 16:18:52 -0700
commit15e35c447058851850155f90292e51decb482956 (patch)
tree0ac7d7cf20002b256362f1e276b08985c2d23365 /daemon/container_windows.go
parent2eaa25d3554dbe9f6d5c4f66a97c8eb83a463880 (diff)
downloaddocker-15e35c447058851850155f90292e51decb482956.tar.gz
Windows: Adds support for Hyper-V Containers
Signed-off-by: John Howard <jhoward@microsoft.com>
Diffstat (limited to 'daemon/container_windows.go')
-rw-r--r--daemon/container_windows.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/daemon/container_windows.go b/daemon/container_windows.go
index 5d62a96d68..6fd956556b 100644
--- a/daemon/container_windows.go
+++ b/daemon/container_windows.go
@@ -5,6 +5,7 @@ package daemon
import (
"strings"
+ "github.com/Sirupsen/logrus"
"github.com/docker/docker/daemon/execdriver"
derr "github.com/docker/docker/errors"
"github.com/docker/docker/volume"
@@ -144,6 +145,7 @@ func populateCommand(c *Container, env []string) error {
LayerFolder: layerFolder,
LayerPaths: layerPaths,
Hostname: c.Config.Hostname,
+ Isolated: c.hostConfig.Isolation.IsHyperV(),
}
return nil
@@ -194,3 +196,26 @@ func (container *Container) ipcMounts() []execdriver.Mount {
func getDefaultRouteMtu() (int, error) {
return -1, errSystemNotSupported
}
+
+// conditionalMountOnStart is a platform specific helper function during the
+// container start to call mount.
+func (container *Container) conditionalMountOnStart() error {
+ // We do not mount if a Hyper-V container
+ if !container.hostConfig.Isolation.IsHyperV() {
+ if err := container.Mount(); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// conditionalUnmountOnCleanup is a platform specific helper function called
+// during the cleanup of a container to unmount.
+func (container *Container) conditionalUnmountOnCleanup() {
+ // We do not unmount if a Hyper-V container
+ if !container.hostConfig.Isolation.IsHyperV() {
+ if err := container.Unmount(); err != nil {
+ logrus.Errorf("%v: Failed to umount filesystem: %v", container.ID, err)
+ }
+ }
+}