docker2aci

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(dockerURL string, squash bool, outputDir string, tmpDir string, username string, password 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 will use the temporary directory specified by tmpDir, or the default temporary directory if tmpDir is "". username and password can be passed if the image needs authentication. It returns the list of generated ACI paths.

func ConvertFile added in v0.5.4

func ConvertFile(dockerURL string, filePath string, squash bool, outputDir string, tmpDir string) ([]string, error)

ConvertFile generates ACI images from a file generated with "docker save". If there are several images/tags in the file, a particular image can be chosen with the syntax:

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

It takes as input the docker-generated file

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 will use the temporary directory specified by tmpDir, or the default temporary directory if tmpDir is "". It returns the list of generated ACI paths.

func GetDockercfgAuth added in v0.5.4

func GetDockercfgAuth(indexServer string) (string, string, error)

GetDockercfgAuth reads a ~/.dockercfg file and returns the username and password of the given docker index server.

func GetIndexName added in v0.5.4

func GetIndexName(dockerURL string) string

GetIndexName returns the docker index server from a docker URL.

func SquashLayers

func SquashLayers(images []acirenderer.Image, aciRegistry acirenderer.ACIRegistry, parsedDockerURL types.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

Types

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.ACIdentifier, 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 Docker2ACIBackend added in v0.5.4

type Docker2ACIBackend interface {
	GetImageInfo(dockerUrl string) ([]string, *types.ParsedDockerURL, error)
	BuildACI(layerID string, dockerURL *types.ParsedDockerURL, outputDir string, tmpBaseDir string, curPWl []string, compress bool) (string, *schema.ImageManifest, error)
}

Directories

Path Synopsis
backend

Jump to

Keyboard shortcuts

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