clair/cmd/clairctl/docker/docker.go

20 lines
667 B
Go
Raw Normal View History

2016-06-09 06:24:55 +00:00
package docker
import (
"github.com/coreos/clair/cmd/clairctl/config"
"github.com/coreos/clair/cmd/clairctl/docker/dockercli"
"github.com/coreos/clair/cmd/clairctl/docker/dockerdist"
"github.com/docker/distribution/manifest/schema1"
"github.com/docker/docker/reference"
)
//RetrieveManifest get manifest from local or remote docker registry
func RetrieveManifest(imageName string, withExport bool) (image reference.Named, manifest schema1.SignedManifest, err error) {
if !config.IsLocal {
image, manifest, err = dockerdist.DownloadV1Manifest(imageName, true)
} else {
image, manifest, err = dockercli.GetLocalManifest(imageName, withExport)
}
return
}