docker

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFabricV1Image = fabricImage + `:1.4`
	DefaultFabricV2Image = fabricImage + `:2.5`
)
View Source
const (
	ContainerGoPath = `/go`
)

Variables

View Source
var ErrContainerNotCreated = errors.New(`container not created`)
View Source
var ErrFileNotFound = errors.New(`file not found`)
View Source
var ErrUnsupportedFabricVersion = errors.New(`unsupported fabric version`)

Functions

func UnTarFirstFile

func UnTarFirstFile(r io.Reader) (*bytes.Buffer, error)

Types

type Container

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

func CreateContainer

func CreateContainer(ctx context.Context, image string, logger *zap.Logger, opts ...CreateContainerOpt) (
	container *Container, err error)

func (*Container) DownloadPath

func (c *Container) DownloadPath(ctx context.Context, path string) ([]byte, error)

func (*Container) Exec

func (c *Container) Exec(ctx context.Context, cmd []string) error

func (*Container) Remove

func (c *Container) Remove(ctx context.Context) error

func (*Container) UploadTar

func (c *Container) UploadTar(ctx context.Context, tar []byte, path string) error

type CreateContainerOpt

type CreateContainerOpt func(*docker.CreateContainerOptions)

type Packer

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

func New

func New(logger *zap.Logger, opts ...PackerOpt) *Packer

func (*Packer) PackFromFiles

func (p *Packer) PackFromFiles(ctx context.Context, spec *ccpackage.PackageSpec, path string) (pkg *ccpackage.Package, err error)

func (*Packer) PackFromTar

func (p *Packer) PackFromTar(ctx context.Context, spec *ccpackage.PackageSpec, tar []byte) (pkg *ccpackage.Package, err error)

type PackerOpt

type PackerOpt func(*Packer)

func UseFabricV1Image

func UseFabricV1Image(image string) PackerOpt

func UseFabricV2Image

func UseFabricV2Image(image string) PackerOpt

Jump to

Keyboard shortcuts

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