docker

package
v0.0.0-...-7e06b0c Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerSourceDir    = "git"
	ContainerArtifactsDir = "result"
	DefaultQuillImage     = "registry.werf.io/trdl/quill:028f446b1b76be918781b24e7f77a6b4c0c74972"
)

Variables

View Source
var ErrImageNameWithoutRequiredDigest = errors.New("the image name must contain an digest \"REPO[:TAG]@DIGEST\" (e.g. \"ubuntu:18.04@sha256:538529c9d229fb55f50e6746b119e899775205d62c0fc1b7e679b30d02ecb6e8\")")

Functions

func BuildReleaseArtifacts

func BuildReleaseArtifacts(ctx context.Context, opts BuildReleaseArtifactsOpts, logger hclog.Logger) error

func GenerateAndAddDockerfileToTar

func GenerateAndAddDockerfileToTar(tw *tar.Writer, dockerfileTarPath, fromImage string, runCommands []string, dockerfileOpts DockerfileOpts) error

func GetMacSigningCommandMounts

func GetMacSigningCommandMounts(creds *mac_signing.Credentials) []string

func GetQuillImage

func GetQuillImage() string

func GetSecretsCommandMounts

func GetSecretsCommandMounts(secrets []secrets.Secret) []string

func GetSecretsRunMounts

func GetSecretsRunMounts(secrets []secrets.Secret) string

func SetMacSigningTempEnvVars

func SetMacSigningTempEnvVars(creds *mac_signing.Credentials) error

func SetTempEnvVars

func SetTempEnvVars(secrets []secrets.Secret) error

func ValidateBuildkitdAddress

func ValidateBuildkitdAddress(ctx context.Context, address string) error

func ValidateBuildkitdDriver

func ValidateBuildkitdDriver(ctx context.Context, driver string) error

ValidateBuildkitdDriver accepts an empty driver, meaning trdl provisions no buildkitd of its own.

func ValidateBuildkitdDriverOpts

func ValidateBuildkitdDriverOpts(ctx context.Context, driver string, driverOpts []string) error

ValidateBuildkitdDriverOpts rejects an option the driver cannot honor while the configuration is being written, rather than at release time. The options have no environment counterpart, so this check is reachable for every value that can ever arrive.

func ValidateBuildxDriver

func ValidateBuildxDriver(ctx context.Context, driver string) error

ValidateBuildxDriver accepts an empty driver, meaning the setting is not in use. The build streams a tarball to stdout (`-o - -`), which the default "docker" driver cannot export, so an unsupported driver is rejected here instead of failing opaquely mid-build.

func ValidateImageNameWithDigest

func ValidateImageNameWithDigest(imageName string) error

Types

type BuildReleaseArtifactsOpts

type BuildReleaseArtifactsOpts struct {
	FromImage           string
	RunCommands         []string
	GitRepo             *git.Repository
	TarWriter           *nio.PipeWriter
	Storage             logical.Storage
	BuildkitdAddress    string
	BuildxDriver        string
	BuildxDriverOpts    []string
	BuildkitdDriver     string
	BuildkitdDriverOpts []string
}

type Builder

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

func NewBuilder

func NewBuilder(ctx context.Context, opts *NewBuilderOpts) (*Builder, error)

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, contextReader *nio.PipeReader, tarWriter *nio.PipeWriter) error

func (*Builder) Remove

func (b *Builder) Remove(ctx context.Context) error

type DockerfileOpts

type DockerfileOpts struct {
	EnvVars               map[string]string
	Labels                map[string]string
	Secrets               []secrets.Secret
	MacSigningCredentials *mac_signing.Credentials
}

type Logger

type Logger interface {
	Info(msg string, args ...interface{})
	Error(msg string, args ...interface{})
}

type NewBuilderOpts

type NewBuilderOpts struct {
	BuildId                 string
	DockerfilePathInContext string
	BuildkitdAddress        string
	BuildxDriver            string
	BuildxDriverOpts        []string
	BuildkitdDriver         string
	BuildkitdDriverOpts     []string
	Secrets                 []secrets.Secret
	MacSigningCredentials   *mac_signing.Credentials
	Logger                  Logger
}

Jump to

Keyboard shortcuts

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