2015-11-12 14:55:17 -05:00
|
|
|
// +build windows
|
|
|
|
|
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2016-01-27 16:03:09 -05:00
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
2015-11-12 14:55:17 -05:00
|
|
|
"github.com/docker/docker/daemon/execdriver"
|
|
|
|
"github.com/docker/docker/volume"
|
2016-01-04 19:05:26 -05:00
|
|
|
"github.com/docker/engine-api/types/container"
|
2015-11-12 14:55:17 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// Container holds fields specific to the Windows implementation. See
|
|
|
|
// CommonContainer for standard fields common to all containers.
|
|
|
|
type Container struct {
|
|
|
|
CommonContainer
|
|
|
|
|
|
|
|
// Fields below here are platform specific.
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateDaemonEnvironment creates a new environment variable slice for this container.
|
|
|
|
func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string {
|
|
|
|
// On Windows, nothing to link. Just return the container environment.
|
|
|
|
return container.Config.Env
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmountIpcMounts unmount Ipc related mounts.
|
|
|
|
// This is a NOOP on windows.
|
|
|
|
func (container *Container) UnmountIpcMounts(unmount func(pth string) error) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// IpcMounts returns the list of Ipc related mounts.
|
|
|
|
func (container *Container) IpcMounts() []execdriver.Mount {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-12-13 11:00:39 -05:00
|
|
|
// UnmountVolumes explicitly unmounts volumes from the container.
|
2015-12-21 19:45:31 -05:00
|
|
|
func (container *Container) UnmountVolumes(forceSyscall bool, volumeEventLog func(name, action string, attributes map[string]string)) error {
|
2015-11-12 14:55:17 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// TmpfsMounts returns the list of tmpfs mounts
|
|
|
|
func (container *Container) TmpfsMounts() []execdriver.Mount {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-12-28 06:19:26 -05:00
|
|
|
// UpdateContainer updates resources of a container
|
|
|
|
func (container *Container) UpdateContainer(hostConfig *container.HostConfig) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-11-12 14:55:17 -05:00
|
|
|
// appendNetworkMounts appends any network mounts to the array of mount points passed in.
|
|
|
|
// Windows does not support network mounts (not to be confused with SMB network mounts), so
|
|
|
|
// this is a no-op.
|
|
|
|
func appendNetworkMounts(container *Container, volumeMounts []volume.MountPoint) ([]volume.MountPoint, error) {
|
|
|
|
return volumeMounts, nil
|
|
|
|
}
|
2016-01-27 16:03:09 -05:00
|
|
|
|
|
|
|
// 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)
|
|
|
|
}
|