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, ...) (path string, err 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, compression common.Compression, username string, password string, insecure bool) ([]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, compression common.Compression) ([]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
GetDockercfgAuth reads a ~/.dockercfg file and returns the username and password of the given docker index server.
func GetIndexName ¶ added in v0.5.4
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, compression common.Compression) (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 ¶ 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)
type Docker2ACIBackend ¶ added in v0.5.4
type Docker2ACIBackend interface { GetImageInfo(dockerUrl string) ([]string, *types.ParsedDockerURL, error) BuildACI(layerNumber int, layerID string, dockerURL *types.ParsedDockerURL, outputDir string, tmpBaseDir string, curPWl []string, compression common.Compression) (string, *schema.ImageManifest, error) }