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 ¶
- func GenerateACI(layerNumber int, layerData types.DockerImageData, ...) (string, *schema.ImageManifest, error)
- func GenerateManifest(layerData types.DockerImageData, dockerURL *types.ParsedDockerURL) (*schema.ImageManifest, error)
- func GetAuthInfo(indexServer string) (string, string, error)
- func ParseDockerURL(arg string) (*types.ParsedDockerURL, error)
- func SplitReposName(reposName string) (string, string)
- func ValidateACI(aciPath string) error
- func WriteManifest(outputWriter *tar.Writer, manifest schema.ImageManifest) error
- func WriteRootfsDir(tarWriter *tar.Writer) error
- type Docker2ACIBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateACI ¶
func GenerateACI(layerNumber int, layerData types.DockerImageData, dockerURL *types.ParsedDockerURL, outputDir string, layerFile *os.File, curPwl []string, compression common.Compression) (string, *schema.ImageManifest, error)
GenerateACI takes a Docker layer and generates an ACI from it.
func GenerateManifest ¶
func GenerateManifest(layerData types.DockerImageData, dockerURL *types.ParsedDockerURL) (*schema.ImageManifest, error)
GenerateManifest converts the docker manifest format to an appc ImageManifest.
func GetAuthInfo ¶
GetDockercfgAuth reads a ~/.dockercfg file and returns the username and password of the given docker index server.
func ParseDockerURL ¶
func ParseDockerURL(arg string) (*types.ParsedDockerURL, error)
ParseDockerURL takes a Docker URL and returns a ParsedDockerURL with its index URL, image name, and tag.
func SplitReposName ¶
SplitReposName breaks a reposName into an index name and remote name.
func ValidateACI ¶
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 ¶
WriteRootfsDir writes a "rootfs" dir entry on a tar.Writer.
Types ¶
type Docker2ACIBackend ¶
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) }
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.