Documentation ¶
Index ¶
- Constants
- func SetupInitLayer(initLayer string) error
- type Graph
- func (graph *Graph) ByParent() (map[string][]*image.Image, error)
- func (graph *Graph) Create(layerData archive.ArchiveReader, ...) (*image.Image, error)
- func (graph *Graph) Delete(name string) error
- func (graph *Graph) Driver() graphdriver.Driver
- func (graph *Graph) Exists(id string) bool
- func (graph *Graph) Get(name string) (*image.Image, error)
- func (graph *Graph) Heads() (map[string]*image.Image, error)
- func (graph *Graph) ImageRoot(id string) string
- func (graph *Graph) IsNotExist(err error) bool
- func (graph *Graph) Map() (map[string]*image.Image, error)
- func (graph *Graph) Mktemp(id string) (string, error)
- func (graph *Graph) Register(jsonData []byte, layerData archive.ArchiveReader, img *image.Image) (err error)
- func (graph *Graph) TempLayerArchive(id string, compression archive.Compression, sf *utils.StreamFormatter, ...) (*archive.TempArchive, error)
- type Repository
- type TagStore
- func (store *TagStore) ByID() map[string][]string
- func (store *TagStore) Delete(repoName, tag string) (bool, error)
- func (store *TagStore) DeleteAll(id string) error
- func (store *TagStore) Get(repoName string) (Repository, error)
- func (store *TagStore) GetImage(repoName, tagOrID string) (*image.Image, error)
- func (store *TagStore) ImageName(id string) string
- func (store *TagStore) LookupImage(name string) (*image.Image, error)
- func (store *TagStore) Reload() error
- func (store *TagStore) Save() error
- func (store *TagStore) Set(repoName, tag, imageName string, force bool) error
Constants ¶
const DEFAULTTAG = "latest"
Variables ¶
This section is empty.
Functions ¶
func SetupInitLayer ¶
setupInitLayer populates a directory with mountpoints suitable for bind-mounting dockerinit into the container. The mountpoint is simply an empty file at /.dockerinit
This extra layer is used by all containers as the top-most ro layer. It protects the container from unwanted side-effects on the rw layer.
Types ¶
type Graph ¶
type Graph struct { Root string // contains filtered or unexported fields }
A Graph is a store for versioned filesystem images and the relationship between them.
func NewGraph ¶
func NewGraph(root string, driver graphdriver.Driver) (*Graph, error)
NewGraph instantiates a new graph at the given root path in the filesystem. `root` will be created if it doesn't exist.
func (*Graph) ByParent ¶
ByParent returns a lookup table of images by their parent. If an image of id ID has 3 children images, then the value for key ID will be a list of 3 images. If an image has no children, it will not have an entry in the table.
func (*Graph) Create ¶
func (graph *Graph) Create(layerData archive.ArchiveReader, containerID, containerImage, comment, author string, containerConfig, config *runconfig.Config) (*image.Image, error)
Create creates a new image and registers it in the graph.
func (*Graph) Driver ¶
func (graph *Graph) Driver() graphdriver.Driver
func (*Graph) Exists ¶
Exists returns true if an image is registered at the given id. If the image doesn't exist or if an error is encountered, false is returned.
func (*Graph) Get ¶
Get returns the image with the given id, or an error if the image doesn't exist.
func (*Graph) Heads ¶
Heads returns all heads in the graph, keyed by id. A head is an image which is not the parent of another image in the graph.
func (*Graph) IsNotExist ¶
FIXME: Implement error subclass instead of looking at the error text Note: This is the way golang implements os.IsNotExists on Plan9
func (*Graph) Register ¶
func (graph *Graph) Register(jsonData []byte, layerData archive.ArchiveReader, img *image.Image) (err error)
Register imports a pre-existing image into the graph. FIXME: pass img as first argument
func (*Graph) TempLayerArchive ¶
func (graph *Graph) TempLayerArchive(id string, compression archive.Compression, sf *utils.StreamFormatter, output io.Writer) (*archive.TempArchive, error)
TempLayerArchive creates a temporary archive of the given image's filesystem layer.
The archive is stored on disk and will be automatically deleted as soon as has been read. If output is not nil, a human-readable progress bar will be written to it. FIXME: does this belong in Graph? How about MktempFile, let the caller use it for archives?
type Repository ¶
type TagStore ¶
type TagStore struct { Repositories map[string]Repository // contains filtered or unexported fields }
func (*TagStore) ByID ¶
Return a reverse-lookup table of all the names which refer to each image Eg. {"43b5f19b10584": {"base:latest", "base:v1"}}