docker

package
v0.0.0-...-91c63a3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2016 License: GPL-2.0 Imports: 11 Imported by: 0

README

Docker module

Description

This is an output module to create docker images. Depending on the input, this may or may not require a connection to a docker daemon.

Support list

Module Docker connection required
file no
tar no

Configuration

TBD.

Development notes

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLayer

func NewLayer(tar []byte, parent, comment string) (layer []byte, err error)

NewLayer creates a new layer from a tarball

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 LayerConfig

type LayerConfig struct {
	Id     string `json:"id"`               // Randomly generated, 256-bit, hexadecimal encoded. Uniquely identifies the image.
	Parent string `json:"parent,omitempty"` /* ID of the parent image. If there is no parent image then this field should be
	   omitted. A collection of images may share many of the same ancestor layers.
	   This organizational structure is strictly a tree with any one layer having
	   either no parent or a single parent and zero or more descendant layers. Cycles
	   are not allowed and implementations should be careful to avoid creating them or
	   iterating through a cycle indefinitely. */
	Comment           string           `json:"comment"`
	Created           time.Time        `json:"created"`                    //ISO-8601 formatted combined date and time at which the image was 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

ContainerConfig is a version-independent way to get the configuration from a layer.

type Port

type Port string

Port is a convient way of dealing with docker ports

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.

Jump to

Keyboard shortcuts

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