summaryrefslogtreecommitdiff
path: root/container/container_windows.go
diff options
context:
space:
mode:
authorDarren Stahl <darst@microsoft.com>2016-01-27 13:03:09 -0800
committerDarren Stahl <darst@microsoft.com>2016-02-05 10:27:10 -0800
commit6791230320fa9f8ae9df3e90d5c52d85621828a0 (patch)
tree9d8a8edaf2aea7aa47948f6ba9e2d508163304bc /container/container_windows.go
parent3fa0d09e74131f4a4dca43a1a28eb014028be62d (diff)
downloaddocker-6791230320fa9f8ae9df3e90d5c52d85621828a0.tar.gz
Combine SetupWorkingDirectory for Linux and Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
Diffstat (limited to 'container/container_windows.go')
-rw-r--r--container/container_windows.go21
1 files changed, 15 insertions, 6 deletions
diff --git a/container/container_windows.go b/container/container_windows.go
index af68086f8d..61a8994244 100644
--- a/container/container_windows.go
+++ b/container/container_windows.go
@@ -3,6 +3,9 @@
package container
import (
+ "os"
+ "path/filepath"
+
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/volume"
"github.com/docker/engine-api/types/container"
@@ -22,12 +25,6 @@ func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string
return container.Config.Env
}
-// SetupWorkingDirectory initializes the container working directory.
-// This is a NOOP In windows.
-func (container *Container) SetupWorkingDirectory() error {
- return nil
-}
-
// UnmountIpcMounts unmount Ipc related mounts.
// This is a NOOP on windows.
func (container *Container) UnmountIpcMounts(unmount func(pth string) error) {
@@ -59,3 +56,15 @@ func (container *Container) UpdateContainer(hostConfig *container.HostConfig) er
func appendNetworkMounts(container *Container, volumeMounts []volume.MountPoint) ([]volume.MountPoint, error) {
return volumeMounts, nil
}
+
+// cleanResourcePath cleans a resource path by removing C:\ syntax, and prepares
+// to combine with a volume path
+func cleanResourcePath(path string) string {
+ if len(path) >= 2 {
+ c := path[0]
+ if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
+ path = path[2:]
+ }
+ }
+ return filepath.Join(string(os.PathSeparator), path)
+}