docker: Index | Files

package overlay

import ""


Package Files



var (
    // ErrApplyDiffFallback is returned to indicate that a normal ApplyDiff is applied as a fallback from Naive diff writer.
    ErrApplyDiffFallback = fmt.Errorf("Fall back to normal ApplyDiff")

func Init Uses

func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error)

Init returns the NaiveDiffDriver, a native diff driver for overlay filesystem. If overlay filesystem is not supported on the host, the error graphdriver.ErrNotSupported is returned. If an overlay filesystem is not supported over an existing filesystem then error graphdriver.ErrIncompatibleFS is returned.

func NaiveDiffDriverWithApply Uses

func NaiveDiffDriverWithApply(driver ApplyDiffProtoDriver, uidMaps, gidMaps []idtools.IDMap) graphdriver.Driver

NaiveDiffDriverWithApply returns a NaiveDiff driver with custom ApplyDiff.

type ApplyDiffProtoDriver Uses

type ApplyDiffProtoDriver interface {
    // ApplyDiff writes the diff to the archive for the given id and parent id.
    // It returns the size in bytes written if successful, an error ErrApplyDiffFallback is returned otherwise.
    ApplyDiff(id, parent string, diff io.Reader) (size int64, err error)

ApplyDiffProtoDriver wraps the ProtoDriver by extending the interface with ApplyDiff method.

type Driver Uses

type Driver struct {
    // contains filtered or unexported fields

Driver contains information about the home directory and the list of active mounts that are created using this driver.

func (*Driver) ApplyDiff Uses

func (d *Driver) ApplyDiff(id string, parent string, diff io.Reader) (size int64, err error)

ApplyDiff applies the new layer on top of the root, if parent does not exist with will return an ErrApplyDiffFallback error.

func (*Driver) Cleanup Uses

func (d *Driver) Cleanup() error

Cleanup any state created by overlay which should be cleaned when daemon is being shutdown. For now, we just have to unmount the bind mounted we had created.

func (*Driver) Create Uses

func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error)

Create is used to create the upper, lower, and merge directories required for overlay fs for a given id. The parent filesystem is used to configure these directories for the overlay.

func (*Driver) CreateReadWrite Uses

func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error

CreateReadWrite creates a layer that is writable for use as a container file system.

func (*Driver) Exists Uses

func (d *Driver) Exists(id string) bool

Exists checks to see if the id is already mounted.

func (*Driver) Get Uses

func (d *Driver) Get(id, mountLabel string) (_ containerfs.ContainerFS, err error)

Get creates and mounts the required file system for the given id and returns the mount path.

func (*Driver) GetMetadata Uses

func (d *Driver) GetMetadata(id string) (map[string]string, error)

GetMetadata returns metadata about the overlay driver such as root, LowerDir, UpperDir, WorkDir and MergeDir used to store data.

func (*Driver) Put Uses

func (d *Driver) Put(id string) error

Put unmounts the mount path created for the give id. It also removes the 'merged' directory to force the kernel to unmount the overlay mount in other namespaces.

func (*Driver) Remove Uses

func (d *Driver) Remove(id string) error

Remove cleans the directories that are created for this id.

func (*Driver) Status Uses

func (d *Driver) Status() [][2]string

Status returns current driver information in a two dimensional string array. Output contains "Backing Filesystem" used in this implementation.

func (*Driver) String Uses

func (d *Driver) String() string

Package overlay imports 22 packages (graph) and is imported by 720 packages. Updated 2020-09-19. Refresh now. Tools for package owners.