示例#1
0
// 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 Convert(dockerURL string, squash bool, outputDir string, tmpDir string, compression common.Compression, username string, password string, insecure bool) ([]string, error) {
	repositoryBackend := repository.NewRepositoryBackend(username, password, insecure)
	return convertReal(repositoryBackend, dockerURL, squash, outputDir, tmpDir, compression)
}
示例#2
0
// 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 Convert(dockerURL string, squash bool, outputDir string, tmpDir string, username string, password string) ([]string, error) {
	repositoryBackend := repository.NewRepositoryBackend(username, password)
	return convertReal(repositoryBackend, dockerURL, squash, outputDir, tmpDir)
}