docker: Index | Files

package containerfs

import ""


Package Files

archiver.go containerfs.go containerfs_unix.go

type Archiver Uses

type Archiver struct {
    SrcDriver Driver
    DstDriver Driver
    Tar       TarFunc
    Untar     UntarFunc
    IDMapping *idtools.IdentityMapping

Archiver provides a similar implementation of the archive.Archiver package with the rootfs abstraction

func (*Archiver) CopyFileWithTar Uses

func (archiver *Archiver) CopyFileWithTar(src, dst string) (retErr error)

CopyFileWithTar emulates the behavior of the 'cp' command-line for a single file. It copies a regular file from path `src` to path `dst`, and preserves all its metadata.

func (*Archiver) CopyWithTar Uses

func (archiver *Archiver) CopyWithTar(src, dst string) error

CopyWithTar creates a tar archive of filesystem path `src`, and unpacks it at filesystem path `dst`. The archive is streamed directly with fixed buffering and no intermediary disk IO.

func (*Archiver) IdentityMapping Uses

func (archiver *Archiver) IdentityMapping() *idtools.IdentityMapping

IdentityMapping returns the IdentityMapping of the archiver.

func (*Archiver) TarUntar Uses

func (archiver *Archiver) TarUntar(src, dst string) error

TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other. If either Tar or Untar fails, TarUntar aborts and returns the error.

func (*Archiver) UntarPath Uses

func (archiver *Archiver) UntarPath(src, dst string) error

UntarPath untar a file from path to a destination, src is the source tar file path.

type ContainerFS Uses

type ContainerFS interface {
    // Path returns the path to the root. Note that this may not exist
    // on the local system, so the continuity operations must be used
    Path() string

    // ResolveScopedPath evaluates the given path scoped to the root.
    // For example, if root=/a, and path=/b/c, then this function would return /a/b/c.
    // If rawPath is true, then the function will not preform any modifications
    // before path resolution. Otherwise, the function will clean the given path
    // by making it an absolute path.
    ResolveScopedPath(path string, rawPath bool) (string, error)


ContainerFS is that represents a root file system

func NewLocalContainerFS Uses

func NewLocalContainerFS(path string) ContainerFS

NewLocalContainerFS is a helper function to implement daemon's Mount interface when the graphdriver mount point is a local path on the machine.

type Driver Uses

type Driver interface {
    // OS returns the OS where the rootfs is located. Essentially,
    // runtime.GOOS for everything aside from LCOW, which is "linux"
    OS() string

    // Architecture returns the hardware architecture where the
    // container is located.
    Architecture() string

    // Driver & PathDriver provide methods to manipulate files & paths

Driver combines both continuity's Driver and PathDriver interfaces with a Platform field to determine the OS.

func NewLocalDriver Uses

func NewLocalDriver() Driver

NewLocalDriver provides file and path drivers for a local file system. They are essentially a wrapper around the `os` and `filepath` functions.

type TarFunc Uses

type TarFunc func(string, *archive.TarOptions) (io.ReadCloser, error)

TarFunc provides a function definition for a custom Tar function

type UntarFunc Uses

type UntarFunc func(io.Reader, string, *archive.TarOptions) error

UntarFunc provides a function definition for a custom Untar function

Package containerfs imports 14 packages (graph) and is imported by 482 packages. Updated 2020-11-04. Refresh now. Tools for package owners.