internal

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package internal provides functions shared by different parts of docker2aci.

Note: this package is an implementation detail and shouldn't be used outside of docker2aci.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateACI

func GenerateACI(layerNumber int, manhash string, layerData types.DockerImageData, dockerURL *common.ParsedDockerURL, outputDir string, layerFile *os.File, curPwl []string, compression common.Compression, debug log.Logger) (string, *schema.ImageManifest, error)

GenerateACI takes a Docker layer and generates an ACI from it.

func GenerateACI22LowerLayer added in v0.12.0

func GenerateACI22LowerLayer(dockerURL *common.ParsedDockerURL, layerDigest string, outputDir string, layerFile *os.File, curPwl []string, compression common.Compression) (string, *schema.ImageManifest, error)

func GenerateACI22TopLayer added in v0.12.0

func GenerateACI22TopLayer(dockerURL *common.ParsedDockerURL, manhash string, imageConfig *typesV2.ImageConfig, layerDigest string, outputDir string, layerFile *os.File, curPwl []string, compression common.Compression, lowerLayers []*schema.ImageManifest, debug log.Logger) (string, *schema.ImageManifest, error)

func GenerateEmptyManifest added in v0.12.0

func GenerateEmptyManifest(name string) (*schema.ImageManifest, error)

func GenerateManifest

func GenerateManifest(layerData types.DockerImageData, manhash string, dockerURL *common.ParsedDockerURL, debug log.Logger) (*schema.ImageManifest, error)

GenerateManifest converts the docker manifest format to an appc ImageManifest.

func GenerateManifestV22 added in v0.12.0

func GenerateManifestV22(
	name string,
	manhash string,
	imageDigest string,
	dockerURL *common.ParsedDockerURL,
	config *typesV2.ImageConfig,
	lowerLayers []*schema.ImageManifest,
	debug log.Logger,
) (*schema.ImageManifest, error)

GenerateManifestV22, given a large set of information (documented a couple lines down), will produce an image manifest compliant with the Dockver V2.2 image spec

func ValidateACI

func ValidateACI(aciPath string) error

ValidateACI checks whether the ACI in aciPath is valid.

func WriteManifest

func WriteManifest(outputWriter *tar.Writer, manifest schema.ImageManifest) error

WriteManifest writes a schema.ImageManifest entry on a tar.Writer.

func WriteRootfsDir

func WriteRootfsDir(tarWriter *tar.Writer) error

WriteRootfsDir writes a "rootfs" dir entry on a tar.Writer.

Types

type Docker2ACIBackend

type Docker2ACIBackend interface {
	// GetImageInfo, given the url for a docker image, will return the
	// following:
	// - []string: an ordered list of all layer hashes
	// - string: a unique identifier for this image, like a hash of the manifest
	// - *common.ParsedDockerURL: a parsed docker URL
	// - error: an error if one occurred
	GetImageInfo(dockerUrl string) ([]string, string, *common.ParsedDockerURL, error)
	BuildACI(layerIDs []string, manhash string, dockerURL *common.ParsedDockerURL, outputDir string, tmpBaseDir string, compression common.Compression) ([]string, []*schema.ImageManifest, error)
}

Docker2ACIBackend is the interface that abstracts converting Docker layers to ACI from where they're stored (remote or file).

GetImageInfo takes a Docker URL and returns a list of layers and the parsed Docker URL.

BuildACI takes a Docker layer, converts it to ACI and returns its output path and its converted ImageManifest.

Directories

Path Synopsis
backend
file
Package file is an implementation of Docker2ACIBackend for files saved via "docker save".
Package file is an implementation of Docker2ACIBackend for files saved via "docker save".
repository
Package repository is an implementation of Docker2ACIBackend for Docker remote registries.
Package repository is an implementation of Docker2ACIBackend for Docker remote registries.
Package tarball provides functions to manipulate tar files.
Package tarball provides functions to manipulate tar files.
Package util defines convenience functions for handling slices and debugging.
Package util defines convenience functions for handling slices and debugging.

Jump to

Keyboard shortcuts

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