docker

package
v0.0.0-...-b9085d8 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerInspectResponse

type DockerInspectResponse struct {
	Id           string
	RepoTags     []string
	RepoDigests  []string
	Parent       string
	Os           string
	Architecture string
	Size         int
	VirtualSize  int
	RootFS       struct {
		Type   string
		Layers []string
	}
}

type ErrorType

type ErrorType int

ErrorType ...

const (
	ErrorTypeUnableToCreateImage       ErrorType = iota
	ErrorTypeUnableToGetImage          ErrorType = iota
	ErrorTypeBadStatusCodeFromGetImage ErrorType = iota
	ErrorTypeUnableToCreateTarFile     ErrorType = iota
	ErrorTypeUnableToCopyTarFile       ErrorType = iota
	ErrorTypeUnableToGetFileStats      ErrorType = iota
)

...

func (ErrorType) String

func (et ErrorType) String() string

type ImagePullError

type ImagePullError struct {
	Code      ErrorType
	RootCause error
}

ImagePullError ...

func (ImagePullError) Error

func (ipe ImagePullError) Error() string

func (*ImagePullError) String

func (ipe *ImagePullError) String() string

type ImagePuller

type ImagePuller struct {
	// contains filtered or unexported fields
}

func NewImagePuller

func NewImagePuller(directory string, registries []RegistryAuth) *ImagePuller

func (*ImagePuller) CreateImageInLocalDocker

func (ip *ImagePuller) CreateImageInLocalDocker(img image) error

CreateImageInLocalDocker could also be implemented using curl: this example hits ... ? the default registry? docker hub?

curl --unix-socket /var/run/docker.sock -X POST http://localhost/images/create?fromImage=alpine

this example hits the kipp registry:

curl --unix-socket /var/run/docker.sock -X POST http://localhost/images/create\?fromImage\=registry.kipp.blackducksoftware.com%2Fblackducksoftware%2Fhub-jobrunner%3A4.5.0

func (*ImagePuller) PullImage

func (ip *ImagePuller) PullImage(pullSpec string) (*PullResult, error)

PullImage gives us access to a docker image by:

  1. hitting a docker create endpoint (?)
  2. pulling down the newly created image and saving as a tarball

It does this by accessing the host's docker daemon, locally, over the docker socket. This gives us a window into any images that are local.

func (*ImagePuller) SaveImageToTar

func (ip *ImagePuller) SaveImageToTar(img image) error

SaveImageToTar -- part of what it does is to issue an http request similar to the following:

curl --unix-socket /var/run/docker.sock -X GET http://localhost/images/openshift%2Forigin-docker-registry%3Av3.6.1/get

type ImagePullerInterface

type ImagePullerInterface interface {
	PullImage(pullSpec string) (*PullResult, error)
}

type PullResult

type PullResult struct {
	Path string
	Repo string
	Tag  string
	Sha  string
}

type RegistryAuth

type RegistryAuth struct {
	URL      string
	User     string
	Password string
}

RegistryAuth ...

type SkopeoImagePuller

type SkopeoImagePuller struct {
	// contains filtered or unexported fields
}

func NewSkopeoImagePuller

func NewSkopeoImagePuller(directory string, registries []RegistryAuth) *SkopeoImagePuller

func (*SkopeoImagePuller) PullImage

func (ip *SkopeoImagePuller) PullImage(pullSpec string) (*PullResult, error)

func (*SkopeoImagePuller) SaveImageToTar

func (ip *SkopeoImagePuller) SaveImageToTar(img image) error

type SkopeoInspectResponse

type SkopeoInspectResponse struct {
	Name         string
	Digest       string
	RepoTags     []string
	Architecture string
	Os           string
	Layers       []string
}

Jump to

Keyboard shortcuts

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