aufs

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAufsNotSupported is returned if aufs is not supported by the host.
	ErrAufsNotSupported = fmt.Errorf("AUFS was not found in /proc/filesystems")
)

Functions

func Init

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

Init returns a new AUFS driver. An error is returned if AUFS is not supported.

func Unmount

func Unmount(target string) error

Unmount the target specified.

Types

type Driver

type Driver struct {
	sync.Mutex // Protects concurrent modification to active
	// contains filtered or unexported fields
}

Driver contains information about the filesystem mounted. root of the filesystem sync.Mutex to protect against concurrent modifications active maps mount id to the count

func (*Driver) ApplyDiff

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

ApplyDiff extracts the changeset from the given diff into the layer with the specified id and parent, returning the size of the new layer in bytes.

func (*Driver) Changes

func (a *Driver) Changes(id, parent string) ([]archive.Change, error)

Changes produces a list of changes between the specified layer and its parent layer. If parent is "", then all changes will be ADD changes.

func (*Driver) Cleanup

func (a *Driver) Cleanup() error

Cleanup aufs and unmount all mountpoints

func (*Driver) Create

func (a *Driver) Create(id, parent string) error

Create three folders for each id mnt, layers, and diff

func (*Driver) Diff

func (a *Driver) Diff(id, parent string) (archive.Archive, error)

Diff produces an archive of the changes between the specified layer and its parent layer which may be "".

func (*Driver) DiffSize

func (a *Driver) DiffSize(id, parent string) (size int64, err error)

DiffSize calculates the changes between the specified id and its parent and returns the size in bytes of the changes relative to its base filesystem directory.

func (*Driver) Exists

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

Exists returns true if the given id is registered with this driver

func (*Driver) Get

func (a *Driver) Get(id, mountLabel string) (string, error)

Get returns the rootfs path for the id. This will mount the dir at it's given path

func (*Driver) GetMetadata added in v1.8.0

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

GetMetadata not implemented

func (*Driver) Migrate

func (a *Driver) Migrate(pth string, setupInit func(p string, rootUID, rootGID int) error) error

Migrate existing images and containers from docker < 0.7.x

The format pre 0.7 is for docker to store the metadata and filesystem content in the same directory. For the migration to work we need to move Image layer data from /var/lib/docker/graph/<id>/layers to the diff of the registered id.

Next we need to migrate the container's rw layer to diff of the driver. After the contents are migrated we need to register the image and container ids with the driver.

For the migration we try to move the folder containing the layer files, if that fails because the data is currently mounted we will fallback to creating a symlink.

func (*Driver) Put

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

Put unmounts and updates list of active mounts.

func (*Driver) Remove

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

Remove will unmount and remove the given id.

func (*Driver) Status

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

Status returns current information about the filesystem such as root directory, number of directories mounted, etc.

func (*Driver) String

func (*Driver) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL