squash

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Hostname        string
	Domainname      string
	User            string
	Memory          int64
	MemorySwap      int64
	CpuShares       int64
	AttachStdin     bool
	AttachStdout    bool
	AttachStderr    bool
	PortSpecs       []string
	ExposedPorts    map[Port]struct{}
	OnBuild         []string
	Tty             bool
	OpenStdin       bool
	StdinOnce       bool
	Env             []string
	Cmd             []string
	Dns             []string // For Docker API v1.9 and below only
	Image           string
	Volumes         map[string]struct{}
	VolumesFrom     string
	WorkingDir      string
	Entrypoint      []string
	NetworkDisabled bool
	Labels          map[string]string
}

type ContainerConfig

type ContainerConfig struct {
	Hostname        string
	Domainname      string
	Entrypoint      []string
	User            string
	Memory          int64
	MemorySwap      int64
	CpuShares       int64
	AttachStdin     bool
	AttachStdout    bool
	AttachStderr    bool
	PortSpecs       []string
	Tty             bool
	OpenStdin       bool
	StdinOnce       bool
	NetworkDisabled bool
	OnBuild         []string
	Env             []string
	Cmd             []string
	Dns             []string
	Image           string
	Volumes         map[string]struct{}
	VolumesFrom     string
	Labels          map[string]string
}

type Export

type Export struct {
	Entries      map[string]*ExportedImage
	Repositories map[string]*TagInfo
	Path         string
	// contains filtered or unexported fields
}

func LoadExport

func LoadExport(conf *configuration.Config, image, location string) (*Export, error)

LoadExport loads a tarball export created by docker save.

func (*Export) ChildOf

func (e *Export) ChildOf(parent string) *ExportedImage

ChildOf returns the child layer or nil of the parent

func (*Export) Extract

func (e *Export) Extract(r io.Reader) error

func (*Export) ExtractLayers

func (e *Export) ExtractLayers() error

func (*Export) FirstFrom

func (e *Export) FirstFrom() *ExportedImage

func (*Export) FirstSquash

func (e *Export) FirstSquash() *ExportedImage

func (*Export) GetById

func (e *Export) GetById(idPrefix string) (*ExportedImage, error)

GetById returns an ExportedImaged with a prefix matching ID. An error is returned multiple ExportedImages matched.

func (*Export) InsertLayer

func (e *Export) InsertLayer(parent string) (*ExportedImage, error)

func (*Export) LastChild

func (e *Export) LastChild() *ExportedImage

func (*Export) PrintHistory

func (e *Export) PrintHistory()

func (*Export) RemoveExtractedLayers

func (e *Export) RemoveExtractedLayers() error

func (*Export) ReplaceLayer

func (e *Export) ReplaceLayer(oldId string) (*ExportedImage, error)

func (*Export) Root

func (e *Export) Root() *ExportedImage

Root returns the top layer in the export

func (*Export) SquashLayers

func (e *Export) SquashLayers(to, from *ExportedImage) error

func (*Export) TarLayers

func (e *Export) TarLayers(w io.Writer) error

func (*Export) WriteRepositoriesJson

func (e *Export) WriteRepositoriesJson() error

type ExportedImage

type ExportedImage struct {
	Path         string
	JsonPath     string
	VersionPath  string
	LayerTarPath string
	LayerDirPath string
	LayerConfig  *LayerConfig
}

func (*ExportedImage) CreateDirs

func (e *ExportedImage) CreateDirs() error

func (*ExportedImage) ExtractLayerDir

func (e *ExportedImage) ExtractLayerDir() error

func (*ExportedImage) RemoveLayerDir

func (e *ExportedImage) RemoveLayerDir() error

func (*ExportedImage) TarLayer

func (e *ExportedImage) TarLayer() error

func (*ExportedImage) WriteJson

func (e *ExportedImage) WriteJson() error

func (*ExportedImage) WriteVersion

func (e *ExportedImage) WriteVersion() error

type LayerConfig

type LayerConfig struct {
	Id                string           `json:"id"`
	Parent            string           `json:"parent,omitempty"`
	Comment           string           `json:"comment"`
	Created           time.Time        `json:"created"`
	V1ContainerConfig *ContainerConfig `json:"ContainerConfig,omitempty"`  // Docker 1.0.0, 1.0.1
	V2ContainerConfig *ContainerConfig `json:"container_config,omitempty"` // All other versions
	Container         string           `json:"container"`
	Config            *Config          `json:"config,omitempty"`
	DockerVersion     string           `json:"docker_version"`
	Architecture      string           `json:"architecture"`
}

func (*LayerConfig) ContainerConfig

func (l *LayerConfig) ContainerConfig() *ContainerConfig

type Port

type Port string

func (Port) Port

func (p Port) Port() string

Port returns the number of the port.

func (Port) Proto

func (p Port) Proto() string

Proto returns the name of the protocol.

type Squasher

type Squasher struct {
	Conf *configuration.Config
}

func (*Squasher) Squash

func (s *Squasher) Squash(input string, output string, tag string) error

type TagInfo

type TagInfo map[string]string

Jump to

Keyboard shortcuts

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