// ConvertSavedFile 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 via FileConfig.DockerURL. // // It returns the list of generated ACI paths. func ConvertSavedFile(dockerSavedFile string, config FileConfig) ([]string, error) { f, err := os.Open(dockerSavedFile) if err != nil { return nil, fmt.Errorf("error opening file: %v", err) } defer f.Close() fileBackend := file.NewFileBackend(f) return convertReal(fileBackend, config.DockerURL, config.Squash, config.OutputDir, config.TmpDir, config.Compression) }
// ConvertSavedFile 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 via FileConfig.DockerURL. // // It returns the list of generated ACI paths. func ConvertSavedFile(dockerSavedFile string, config FileConfig) ([]string, error) { config.initLogger() f, err := os.Open(dockerSavedFile) if err != nil { return nil, fmt.Errorf("error opening file: %v", err) } defer f.Close() return (&converter{ backend: file.NewFileBackend(f, config.Debug, config.Info), dockerURL: config.DockerURL, config: config.CommonConfig, }).convert() }