docker

package
v0.0.0-...-346b299 Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DockerHub = "registry-1.docker.io"

Variables

View Source
var IsLocal = false

Functions

func Analyse

func Analyse(image Image) clair.ImageAnalysis

Analyse return Clair Image analysis

func AuthenticateResponse

func AuthenticateResponse(dockerResponse *http.Response, request *http.Request) error

func BearerAuthParams

func BearerAuthParams(r *http.Response) map[string]string

BearerAuthParams parse Bearer Token on Www-Authenticate header

func FromHistory

func FromHistory(im *Image) error

FromHistory populate image.FSLayers with the layer from `docker history` command

func Login

func Login(registry string) (bool, error)

Pull Image from Registry or Hub depending on image name

func Prepare

func Prepare(im *Image) error

Prepare populate image.FSLayers with the layer from manifest coming from `docker save` command. Layer.History will be populated with `docker history` command

func Push

func Push(image Image) error

Push image to Clair for analysis

func TmpLocal

func TmpLocal() string

Types

type Image

type Image struct {
	Name     string
	Tag      string
	Registry string
	FsLayers []Layer
}

Image represent Image Manifest from Docker image, including the registry URL

func Parse

func Parse(image string) (Image, error)

Parse is used to parse a docker image command

Example: "register.com:5080/wemanity-belgium/alpine" "register.com:5080/wemanity-belgium/alpine:latest" "register.com:5080/alpine" "register.com/wemanity-belgium/alpine" "register.com/alpine" "register.com/wemanity-belgium/alpine:latest" "alpine" "wemanity-belgium/alpine" "wemanity-belgium/alpine:latest"

func Pull

func Pull(imageName string) (Image, error)

Pull Image from Registry or Hub depending on image name

func (Image) AsJSON

func (image Image) AsJSON() (string, error)

func (Image) BlobsURI

func (image Image) BlobsURI(digest string) string

BlobsURI run Blobs URI as <registry>/<imageName>/blobs/<digest> eg: "http://registry:5000/v2/jgsqware/ubuntu-git/blobs/sha256:13be4a52fdee2f6c44948b99b5b65ec703b1ca76c1ab5d2d90ae9bf18347082e"

func (Image) String

func (image Image) String() string

type Layer

type Layer struct {
	BlobSum string
	History string
}

Layer represent the digest of a image layer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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