Documentation ¶
Overview ¶
Package docker2aci implements a simple library for converting docker images to App Container Images (ACIs).
Index ¶
- func Convert(dockerURL string, squash bool, outputDir string, tmpDir string, ...) ([]string, error)
- func ConvertFile(dockerURL string, filePath string, squash bool, outputDir string, ...) ([]string, error)
- func GetDockercfgAuth(indexServer string) (string, string, error)
- func GetIndexName(dockerURL string) string
- func SquashLayers(images []acirenderer.Image, aciRegistry acirenderer.ACIRegistry, ...) (string, error)
- type ConversionStore
- func (ms *ConversionStore) GetACI(name types.ACIdentifier, labels types.Labels) (string, error)
- func (ms *ConversionStore) GetImageManifest(key string) (*schema.ImageManifest, error)
- func (ms *ConversionStore) HashToKey(h hash.Hash) string
- func (ms *ConversionStore) ReadStream(key string) (io.ReadCloser, error)
- func (ms *ConversionStore) ResolveKey(key string) (string, error)
- func (ms *ConversionStore) WriteACI(path string) (string, error)
- type Docker2ACIBackend
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 ¶
GetDockercfgAuth reads a ~/.dockercfg file and returns the username and password of the given docker index server.
func GetIndexName ¶
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 ¶
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) ReadStream ¶
func (ms *ConversionStore) ReadStream(key string) (io.ReadCloser, error)
func (*ConversionStore) ResolveKey ¶
func (ms *ConversionStore) ResolveKey(key string) (string, error)