layerbuilder

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTarToLayer

func AddTarToLayer(imageDir, tarFile string) error

AddTarToLayer copies a tar file into a image directory and update its metadata

Types

type Config

type Config struct {
	Hostname     string
	Domainname   string
	User         string
	AttachStdin  bool
	AttachStdout bool
	AttachStderr bool
	Tty          bool
	OpenStdin    bool
	StdinOnce    bool
	Env          []string
	Cmd          []string
	ArgsEscaped  bool
	Image        string
	Volumes      interface{}
	WorkingDir   string
	Entrypoint   interface{}
	OnBuild      interface{}
	Labels       interface{}
}

Config represents a container configuration

type Description

type Description struct {
	Arch            string         `json:"architecture"`
	Config          Config         `json:"config"`
	Container       string         `json:"container"`
	ContainerConfig Config         `json:"container_config"`
	Created         string         `json:"created"`
	DockerVersion   string         `json:"docker_version"`
	History         []HistoryEntry `json:"history"`
	OS              string         `json:"os"`
	Rootfs          Rootfs         `json:"rootfs"`
}

Description represents the specification of a Docker image

func (*Description) AddLayer

func (d *Description) AddLayer(newLayer *Layer)

AddLayer adds a new Layer to the image Description

func (*Description) Content

func (d *Description) Content() ([]byte, error)

Content returns the description content

func (*Description) New

func (d *Description) New(descriptionFile io.Reader) error

New generates a Description object based on the description file

func (*Description) ToLayer

func (d *Description) ToLayer() (*Layer, error)

ToLayer returns the Description as a Layer

type HistoryEntry

type HistoryEntry struct {
	Created    string `json:"created"`
	CreatedBy  string `json:"created_by,omitifempty"`
	Comment    string `json:"comment,omitifempty"`
	EmptyLayer bool   `json:"empty_layer,omitifempty"`
}

HistoryEntry represents a layer creation info

type Layer

type Layer struct {
	Size   int64
	Sha256 string
}

Layer represent the size and checksum of a image layer

func (*Layer) New

func (f *Layer) New(layerFile *os.File) error

New returns a Layer based on its file

type Manifest

type Manifest struct {
	SchemaVersion int     `json:"schemaVersion"`
	MediaType     string  `json:"mediaType"`
	Config        layer   `json:"config"`
	Layers        []layer `json:"layers"`
}

Manifest represent the manifest.json of an image

func (*Manifest) AddLayer

func (m *Manifest) AddLayer(newLayer *Layer)

AddLayer adds a new layer to the list in the Manifest

func (*Manifest) New

func (m *Manifest) New(manifestFile io.Reader) error

New parses an io.Reader into a Manifest

func (*Manifest) UpdateConfig

func (m *Manifest) UpdateConfig(newConfig *Layer)

UpdateConfig overrides the Config information of the manifest with a new Layer

type Rootfs

type Rootfs struct {
	Type    string   `json:"type"`
	DiffIds []string `json:"diff_ids"`
}

Rootfs represents the root filesystem of an image

Jump to

Keyboard shortcuts

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