layer

package
v0.0.0-...-88aa921 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Maximum layer count is set and enforced by docker:
	//  https://github.com/docker/docker/blob/101c749b6533ab309eccea6b6c6173a0c25f787d/image/image.go#L308
	MAX_LAYER_COUNT  int = 127 - 2
	WARN_LAYER_COUNT int = MAX_LAYER_COUNT - 16
)

Variables

View Source
var FilesToIgnore = map[string]struct{}{
	".dockerenv":      struct{}{},
	".dockerinit":     struct{}{},
	"./":              struct{}{},
	"dev/":            struct{}{},
	"dev/console":     struct{}{},
	"dev/shm/":        struct{}{},
	"etc/":            struct{}{},
	"etc/hostname":    struct{}{},
	"etc/hosts":       struct{}{},
	"etc/mtab":        struct{}{},
	"etc/resolv.conf": struct{}{},
}

FilesToIgnore are the files that Squash will ignore when computing diffs.

Functions

func Squash

func Squash(client DockerClient, imageName, downToLayer, newName, tempDir string) (resultImageID string, err error)

Squash flattens the image down to the downToLayer and optionally retag the generated layer with newName. The resulting layer is returned in resultImageID.

Types

type DockerClient

type DockerClient interface {
	CreateContainer(docker.CreateContainerOptions) (*docker.Container, error)
	RemoveContainer(docker.RemoveContainerOptions) error
	ExportContainer(docker.ExportContainerOptions) error
	InspectImage(name string) (*docker.Image, error)
	ImportImage(docker.ImportImageOptions) error
}

DockerClient is the minimal docker client interface this package needs.

Jump to

Keyboard shortcuts

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