docker

package
v0.0.0-...-b49e32a Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() (*client.Client, error)

Client get a docker client.

func Create

func Create(image string, withNetwork bool) (string, error)

Create create a container from the given image in docker, returning the full hash ID of the created container. Does not start the container.

func Export

func Export(container string) (io.ReadCloser, error)

Export export the provided container ID from docker using `docker export`. The container must already exist.

func HasImage

func HasImage(ref *reference.Spec) error

HasImage check if the provided ref is available in the docker cache.

func InspectImage

func InspectImage(cli *client.Client, ref *reference.Spec) (dockertypes.ImageInspect, error)

InspectImage inspect the provided ref.

func Rm

func Rm(container string) error

Rm remove the given container from docker.

func Save

func Save(image string) (io.ReadCloser, error)

Save save the provided image ref.

Types

type ImageSource

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

ImageSource a source for an image in the docker engine. Implements a moby.ImageSource.

func NewSource

func NewSource(ref *reference.Spec) ImageSource

NewSource return an ImageSource for a specific ref from docker.

func (ImageSource) Config

func (d ImageSource) Config() (imagespec.ImageConfig, error)

Config return the imagespec.ImageConfig for the given source.

func (ImageSource) Descriptor

func (d ImageSource) Descriptor() *v1.Descriptor

Descriptor return the descriptor of the image.

func (ImageSource) SBoMs

func (d ImageSource) SBoMs() ([]io.ReadCloser, error)

SBoM not supported in docker, but it is not an error, so just return nil.

func (ImageSource) TarReader

func (d ImageSource) TarReader() (io.ReadCloser, error)

TarReader return an io.ReadCloser to read the filesystem contents of the image.

func (ImageSource) V1TarReader

func (d ImageSource) V1TarReader(overrideName string) (io.ReadCloser, error)

V1TarReader return an io.ReadCloser to read the save of the image

Jump to

Keyboard shortcuts

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