docker2aci

package
v0.0.0-...-d03b0ea Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2015 License: Apache-2.0 Imports: 20 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

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

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

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) (path string, err 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

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

func NewConversionStore() *ConversionStore

func (*ConversionStore) GetACI

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

func (*ConversionStore) GetImageManifest

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

func (*ConversionStore) HashToKey

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

func (*ConversionStore) ReadStream

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

func (*ConversionStore) ResolveKey

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

func (*ConversionStore) WriteACI

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

type Docker2ACIBackend

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