daemon/volumes_windows.go
ba1725a9
 // +build windows
 
 package daemon
 
bd9814f0
 import (
63efc120
 	"sort"
 
6bb0d181
 	"github.com/docker/docker/container"
a7e686a7
 	"github.com/docker/docker/volume"
bd9814f0
 )
81fa9feb
 
a7e686a7
 // setupMounts configures the mount points for a container by appending each
8af4f89c
 // of the configured mounts on the container to the OCI mount structure
 // which will ultimately be passed into the oci runtime during container creation.
a7e686a7
 // It also ensures each of the mounts are lexographically sorted.
94d70d83
 
 // BUGBUG TODO Windows containerd. This would be much better if it returned
02309170
 // an array of runtime spec mounts, not container mounts. Then no need to
94d70d83
 // do multiple transitions.
 
 func (daemon *Daemon) setupMounts(c *container.Container) ([]container.Mount, error) {
 	var mnts []container.Mount
 	for _, mount := range c.MountPoints { // type is volume.MountPoint
 		if err := daemon.lazyInitializeVolume(c.ID, mount); err != nil {
aab35963
 			return nil, err
2aa673ae
 		}
b1526400
 		s, err := mount.Setup(c.MountLabel, 0, 0)
 		if err != nil {
 			return nil, err
a7e686a7
 		}
b1526400
 
94d70d83
 		mnts = append(mnts, container.Mount{
a7e686a7
 			Source:      s,
 			Destination: mount.Destination,
 			Writable:    mount.RW,
 		})
 	}
 
 	sort.Sort(mounts(mnts))
 	return mnts, nil
b9e4b957
 }
71eadd41
 
a7e686a7
 // setBindModeIfNull is platform specific processing which is a no-op on
 // Windows.
fc7b904d
 func setBindModeIfNull(bind *volume.MountPoint) {
 	return
a7e686a7
 }