docker: github.com/docker/docker/volume/local Index | Files

package local

import "github.com/docker/docker/volume/local"

Package local provides the default implementation for volumes. It is used to mount data volume containers and directories local to the host server.

Package local provides the default implementation for volumes. It is used to mount data volume containers and directories local to the host server.

Index

Package Files

local.go local_unix.go

Constants

const (
    VolumeDataPathName = "_data"
)

VolumeDataPathName is the name of the directory where the volume data is stored. It uses a very distinctive name to avoid collisions migrating data between Docker versions.

Variables

var (
    // ErrNotFound is the typed error returned when the requested volume name can't be found
    ErrNotFound = fmt.Errorf("volume not found")
)

type Root Uses

type Root struct {
    // contains filtered or unexported fields
}

Root implements the Driver interface for the volume package and manages the creation/removal of volumes. It uses only standard vfs commands to create/remove dirs within its provided scope.

func New Uses

func New(scope string, rootIdentity idtools.Identity) (*Root, error)

New instantiates a new Root instance with the provided scope. Scope is the base path that the Root instance uses to store its volumes. The base path is created here if it does not exist.

func (*Root) Create Uses

func (r *Root) Create(name string, opts map[string]string) (volume.Volume, error)

Create creates a new volume.Volume with the provided name, creating the underlying directory tree required for this volume in the process.

func (*Root) DataPath Uses

func (r *Root) DataPath(volumeName string) string

DataPath returns the constructed path of this volume.

func (*Root) Get Uses

func (r *Root) Get(name string) (volume.Volume, error)

Get looks up the volume for the given name and returns it if found

func (*Root) List Uses

func (r *Root) List() ([]volume.Volume, error)

List lists all the volumes

func (*Root) Name Uses

func (r *Root) Name() string

Name returns the name of Root, defined in the volume package in the DefaultDriverName constant.

func (*Root) Remove Uses

func (r *Root) Remove(v volume.Volume) error

Remove removes the specified volume and all underlying data. If the given volume does not belong to this driver and an error is returned. The volume is reference counted, if all references are not released then the volume is not removed.

func (*Root) Scope Uses

func (r *Root) Scope() string

Scope returns the local volume scope

Package local imports 21 packages (graph) and is imported by 546 packages. Updated 2021-01-16. Refresh now. Tools for package owners.