v0.4.2 Latest Latest

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

Go to latest
Published: Mar 19, 2015 License: Apache-2.0 Imports: 18 Imported by: 0



Package docker2aci implements a simple library for converting docker images to App Container Images (ACIs).



This section is empty.


This section is empty.


func Convert

func Convert(dockerURL string, squash bool, outputDir string) ([]string, error)

Convert generates ACI images from docker registry URLs. It takes as input a dockerURL of the form:

{docker registry URL}/{image name}:{tag}

It then gets all the layers of the requested image and converts each of them to ACI. If the squash flag is true, it squashes all the layers in one file and places this file in outputDir; if it is false, it places every layer in its own ACI in outputDir. It returns the list of generated ACI paths.

func SquashLayers

func SquashLayers(images []acirenderer.Image, aciRegistry acirenderer.ACIRegistry, parsedDockerURL ParsedDockerURL, outputDir string) (string, error)

SquashLayers receives a list of ACI layer file names ordered from base image to application image and squashes them into one ACI


type ConversionStore added in v0.4.2

type ConversionStore struct {
	// contains filtered or unexported fields

ConversionStore is an simple implementation of the acirenderer.ACIRegistry interface. It stores the Docker layers converted to ACI so we can take advantage of acirenderer to generate a squashed ACI Image.

func NewConversionStore added in v0.4.2

func NewConversionStore() *ConversionStore

func (*ConversionStore) GetACI added in v0.4.2

func (ms *ConversionStore) GetACI(name types.ACName, labels types.Labels) (string, error)

func (*ConversionStore) GetImageManifest added in v0.4.2

func (ms *ConversionStore) GetImageManifest(key string) (*schema.ImageManifest, error)

func (*ConversionStore) HashToKey added in v0.4.2

func (ms *ConversionStore) HashToKey(h hash.Hash) string

func (*ConversionStore) ReadStream added in v0.4.2

func (ms *ConversionStore) ReadStream(key string) (io.ReadCloser, error)

func (*ConversionStore) ResolveKey added in v0.4.2

func (ms *ConversionStore) ResolveKey(key string) (string, error)

func (*ConversionStore) WriteACI added in v0.4.2

func (ms *ConversionStore) WriteACI(path string) (string, error)

type DockerImageConfig

type DockerImageConfig struct {
	Hostname        string
	Domainname      string
	User            string
	Memory          int64  // Memory limit (in bytes)
	MemorySwap      int64  // Total memory usage (memory + swap); set `-1' to disable swap
	CpuShares       int64  // CPU shares (relative weight vs. other containers)
	Cpuset          string // Cpuset 0-2, 0,1
	AttachStdin     bool
	AttachStdout    bool
	AttachStderr    bool
	PortSpecs       []string // Deprecated - Can be in the format of 8080/tcp
	ExposedPorts    map[string]struct{}
	Tty             bool // Attach standard streams to a tty, including stdin if it is not closed.
	OpenStdin       bool // Open stdin
	StdinOnce       bool // If true, close stdin after the 1 attached client disconnects.
	Env             []string
	Cmd             []string
	Image           string // Name of the image as it was passed by the operator (eg. could be symbolic)
	Volumes         map[string]struct{}
	WorkingDir      string
	Entrypoint      []string
	NetworkDisabled bool
	MacAddress      string
	OnBuild         []string

Note: the Config structure should hold only portable information about the container. Here, "portable" means "independent from the host we are running on". Non-portable information *should* appear in HostConfig. Taken and adapted from upstream Docker.

type DockerImageData

type DockerImageData struct {
	ID              string             `json:"id"`
	Parent          string             `json:"parent,omitempty"`
	Comment         string             `json:"comment,omitempty"`
	Created         time.Time          `json:"created"`
	Container       string             `json:"container,omitempty"`
	ContainerConfig DockerImageConfig  `json:"container_config,omitempty"`
	DockerVersion   string             `json:"docker_version,omitempty"`
	Author          string             `json:"author,omitempty"`
	Config          *DockerImageConfig `json:"config,omitempty"`
	Architecture    string             `json:"architecture,omitempty"`
	OS              string             `json:"os,omitempty"`
	Checksum        string             `json:"checksum"`

DockerImageData stores the JSON structure of a Docker image. Taken and adapted from upstream Docker.

type ParsedDockerURL

type ParsedDockerURL struct {
	IndexURL  string
	ImageName string
	Tag       string

type RepoData

type RepoData struct {
	Tokens    []string
	Endpoints []string
	Cookie    []string

Jump to

Keyboard shortcuts

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