docker

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SectionStartingBuild                 = "Starting build"
	SectionInstallingSystemPackages      = "Installing system packages"
	SectionInstallingPythonPrerequisites = "Installing Python prerequisites"
	SectionInstallingPython              = "Installing Python"
	SectionInstallingPythonRequirements  = "Installing Python requirements"
	SectionInstallingPythonPackages      = "Installing Python packages"
	SectionInstallingCog                 = "Installing Cog"
	SectionCopyingCode                   = "Copying code"
	SectionPreInstall                    = "Running pre-install script"
)
View Source
const SectionPrefix = "### --> "

Variables

This section is empty.

Functions

func Exists

func Exists(tag string, logWriter logger.Logger) bool

func Pull

func Pull(tag string, logWriter logger.Logger) error

Types

type DockerfileGenerator

type DockerfileGenerator struct {
	Config *model.Config
	Arch   string
	Dir    string

	// these are here to make this type testable
	GOOS   string
	GOARCH string
	// contains filtered or unexported fields
}

func NewDockerfileGenerator

func NewDockerfileGenerator(config *model.Config, arch string, dir string) *DockerfileGenerator

func (*DockerfileGenerator) Cleanup

func (g *DockerfileGenerator) Cleanup() error

func (*DockerfileGenerator) Generate

func (g *DockerfileGenerator) Generate() (string, error)

func (*DockerfileGenerator) GenerateBase

func (g *DockerfileGenerator) GenerateBase() (string, error)

type ImageBuilder

type ImageBuilder interface {
	Build(ctx context.Context, dir string, dockerfileContents string, name string, useGPU bool, logWriter logger.Logger) (tag string, err error)
	Push(ctx context.Context, tag string, logWriter logger.Logger) error
	Cleanup(dockerTag string) error
}

type LocalImageBuilder

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

func NewLocalImageBuilder

func NewLocalImageBuilder(registry string) *LocalImageBuilder

func (*LocalImageBuilder) Build

func (b *LocalImageBuilder) Build(ctx context.Context, dir string, dockerfileContents string, name string, useGPU bool, logWriter logger.Logger) (tag string, err error)

func (*LocalImageBuilder) Cleanup

func (b *LocalImageBuilder) Cleanup(dockerTag string) error

func (*LocalImageBuilder) Push

func (b *LocalImageBuilder) Push(ctx context.Context, tag string, logWriter logger.Logger) error

type MockBuildFunc

type MockBuildFunc func(ctx context.Context, dir string, dockerfileContents string, name string, useGPU bool, logWriter logger.Logger) (tag string, err error)

type MockImageBuilder

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

func NewMockImageBuilder

func NewMockImageBuilder(buildFunc MockBuildFunc) *MockImageBuilder

func (*MockImageBuilder) Build

func (m *MockImageBuilder) Build(ctx context.Context, dir string, dockerfileContents string, name string, useGPU bool, logWriter logger.Logger) (tag string, err error)

func (*MockImageBuilder) Cleanup

func (m *MockImageBuilder) Cleanup(imageURI string) error

func (*MockImageBuilder) Push

func (m *MockImageBuilder) Push(ctx context.Context, tag string, logWriter logger.Logger) error

Jump to

Keyboard shortcuts

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