MCPcopy Create free account
hub / github.com/docker/cli / handleBindToMount

Function handleBindToMount

cli/compose/convert/volume.go:120–144  ·  view source on GitHub ↗
(volume composetypes.ServiceVolumeConfig)

Source from the content-addressed store, hash-verified

118}
119
120func handleBindToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {
121 result := createMountFromVolume(volume)
122
123 if volume.Source == "" {
124 return mount.Mount{}, errors.New("invalid bind source, source cannot be empty")
125 }
126 if volume.Volume != nil {
127 return mount.Mount{}, errors.New("volume options are incompatible with type bind")
128 }
129 if volume.Image != nil {
130 return mount.Mount{}, errors.New("image options are incompatible with type bind")
131 }
132 if volume.Tmpfs != nil {
133 return mount.Mount{}, errors.New("tmpfs options are incompatible with type bind")
134 }
135 if volume.Cluster != nil {
136 return mount.Mount{}, errors.New("cluster options are incompatible with type bind")
137 }
138 if volume.Bind != nil {
139 result.BindOptions = &mount.BindOptions{
140 Propagation: mount.Propagation(volume.Bind.Propagation),
141 }
142 }
143 return result, nil
144}
145
146func handleTmpfsToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {
147 result := createMountFromVolume(volume)

Callers 1

convertVolumeToMountFunction · 0.85

Calls 1

createMountFromVolumeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…