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

Function handleTmpfsToMount

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

Source from the content-addressed store, hash-verified

144}
145
146func handleTmpfsToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {
147 result := createMountFromVolume(volume)
148
149 if volume.Source != "" {
150 return mount.Mount{}, errors.New("invalid tmpfs source, source must be empty")
151 }
152 if volume.Bind != nil {
153 return mount.Mount{}, errors.New("bind options are incompatible with type tmpfs")
154 }
155 if volume.Volume != nil {
156 return mount.Mount{}, errors.New("volume options are incompatible with type tmpfs")
157 }
158 if volume.Image != nil {
159 return mount.Mount{}, errors.New("image options are incompatible with type tmpfs")
160 }
161 if volume.Cluster != nil {
162 return mount.Mount{}, errors.New("cluster options are incompatible with type tmpfs")
163 }
164 if volume.Tmpfs != nil {
165 result.TmpfsOptions = &mount.TmpfsOptions{
166 SizeBytes: volume.Tmpfs.Size,
167 }
168 }
169 return result, nil
170}
171
172func handleNpipeToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {
173 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…