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

Method Mounts

cli/command/formatter/container.go:313–328  ·  view source on GitHub ↗

Mounts returns a comma-separated string of mount names present on the container. If the trunc option is set, names can be truncated (ellipsized).

()

Source from the content-addressed store, hash-verified

311// Mounts returns a comma-separated string of mount names present on the container.
312// If the trunc option is set, names can be truncated (ellipsized).
313func (c *ContainerContext) Mounts() string {
314 var name string
315 mounts := make([]string, 0, len(c.c.Mounts))
316 for _, m := range c.c.Mounts {
317 if m.Name == "" {
318 name = m.Source
319 } else {
320 name = m.Name
321 }
322 if c.trunc {
323 name = Ellipsis(name, 15)
324 }
325 mounts = append(mounts, name)
326 }
327 return strings.Join(mounts, ",")
328}
329
330// LocalVolumes returns the number of volumes using the "local" volume driver.
331func (c *ContainerContext) LocalVolumes() string {

Callers

nothing calls this directly

Calls 1

EllipsisFunction · 0.70

Tested by

no test coverage detected