buildah

package
v1.2.46 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShmSize              = "65536k"
	BuildahImage                = "ghcr.io/werf/buildah:v1.22.3-1"
	BuildahStorageContainerName = "werf-buildah-storage"
)
View Source
const (
	MaxPullPushRetries = 3
	PullPushRetryDelay = 2 * time.Second
)

Variables

This section is empty.

Functions

func BuildahWithFuseDockerArgs added in v1.2.35

func BuildahWithFuseDockerArgs(storageContainerName, dockerConfigDir string) []string

func NativeRootlessProcessStartupHook

func NativeRootlessProcessStartupHook() bool

func ProcessStartupHook

func ProcessStartupHook(mode Mode) (bool, error)

Types

type BaseBuildah

type BaseBuildah struct {
	TmpDir   string
	Insecure bool
}

func NewBaseBuildah

func NewBaseBuildah(tmpDir string, opts BaseBuildahOpts) (*BaseBuildah, error)

func (*BaseBuildah) NewSessionTmpDir

func (b *BaseBuildah) NewSessionTmpDir() (string, error)

type BaseBuildahOpts added in v1.2.35

type BaseBuildahOpts struct {
	Insecure bool
}

type BuildFromDockerfileOpts

type BuildFromDockerfileOpts struct {
	CommonOpts
	ContextTar io.Reader
	BuildArgs  map[string]string
}

type Buildah

type Buildah interface {
	Tag(ctx context.Context, ref, newRef string, opts TagOpts) error
	Push(ctx context.Context, ref string, opts PushOpts) error
	BuildFromDockerfile(ctx context.Context, dockerfile []byte, opts BuildFromDockerfileOpts) (string, error)
	RunCommand(ctx context.Context, container string, command []string, opts RunCommandOpts) error
	FromCommand(ctx context.Context, container string, image string, opts FromCommandOpts) (string, error)
	Pull(ctx context.Context, ref string, opts PullOpts) error
	Inspect(ctx context.Context, ref string) (*types.BuilderInfo, error)
	Rmi(ctx context.Context, ref string, opts RmiOpts) error
	Mount(ctx context.Context, container string, opts MountOpts) (string, error)
	Umount(ctx context.Context, container string, opts UmountOpts) error
}

func NewBuildah

func NewBuildah(mode Mode, opts BuildahOpts) (b Buildah, err error)

type CommonBuildahOpts

type CommonBuildahOpts struct {
	TmpDir   string
	Insecure bool
}

type CommonOpts

type CommonOpts struct {
	LogWriter io.Writer
}

type DockerWithFuseBuildah

type DockerWithFuseBuildah struct {
	BaseBuildah
}

func NewDockerWithFuseBuildah

func NewDockerWithFuseBuildah(commonOpts CommonBuildahOpts, opts DockerWithFuseModeOpts) (*DockerWithFuseBuildah, error)

func (*DockerWithFuseBuildah) BuildFromDockerfile

func (b *DockerWithFuseBuildah) BuildFromDockerfile(ctx context.Context, dockerfile []byte, opts BuildFromDockerfileOpts) (string, error)

func (*DockerWithFuseBuildah) FromCommand

func (b *DockerWithFuseBuildah) FromCommand(ctx context.Context, container string, image string, opts FromCommandOpts) (string, error)

func (*DockerWithFuseBuildah) Inspect

TODO(ilya-lesikov): make it more generic to handle not only images

func (*DockerWithFuseBuildah) Mount added in v1.2.46

func (b *DockerWithFuseBuildah) Mount(ctx context.Context, container string, opts MountOpts) (string, error)

func (*DockerWithFuseBuildah) Pull

func (b *DockerWithFuseBuildah) Pull(ctx context.Context, ref string, opts PullOpts) error

func (*DockerWithFuseBuildah) Push

func (b *DockerWithFuseBuildah) Push(ctx context.Context, ref string, opts PushOpts) error

func (*DockerWithFuseBuildah) Rmi

func (b *DockerWithFuseBuildah) Rmi(ctx context.Context, ref string, opts RmiOpts) error

func (*DockerWithFuseBuildah) RunCommand

func (b *DockerWithFuseBuildah) RunCommand(ctx context.Context, container string, command []string, opts RunCommandOpts) error

func (*DockerWithFuseBuildah) Tag

func (b *DockerWithFuseBuildah) Tag(ctx context.Context, ref, newRef string, opts TagOpts) error

func (*DockerWithFuseBuildah) Umount added in v1.2.46

func (b *DockerWithFuseBuildah) Umount(ctx context.Context, container string, opts UmountOpts) error

type DockerWithFuseModeOpts

type DockerWithFuseModeOpts struct{}

type FromCommandOpts

type FromCommandOpts CommonOpts

type Mode

type Mode string
const (
	ModeAuto           Mode = "auto"
	ModeNativeRootless Mode = "native-rootless"
	ModeDockerWithFuse Mode = "docker-with-fuse"
)

func ResolveMode

func ResolveMode(mode Mode) Mode

type MountOpts added in v1.2.46

type MountOpts CommonOpts

type NativeRootlessBuildah

type NativeRootlessBuildah struct {
	BaseBuildah

	Store   storage.Store
	Runtime libimage.Runtime
}

func NewNativeRootlessBuildah

func NewNativeRootlessBuildah(commonOpts CommonBuildahOpts, opts NativeRootlessModeOpts) (*NativeRootlessBuildah, error)

func (*NativeRootlessBuildah) BuildFromDockerfile

func (b *NativeRootlessBuildah) BuildFromDockerfile(ctx context.Context, dockerfile []byte, opts BuildFromDockerfileOpts) (string, error)

func (*NativeRootlessBuildah) FromCommand

func (b *NativeRootlessBuildah) FromCommand(ctx context.Context, container string, image string, opts FromCommandOpts) (string, error)

func (*NativeRootlessBuildah) Inspect

Inspect returns nil, nil if image not found.

func (*NativeRootlessBuildah) Mount added in v1.2.46

func (b *NativeRootlessBuildah) Mount(ctx context.Context, container string, opts MountOpts) (string, error)

func (*NativeRootlessBuildah) Pull

func (b *NativeRootlessBuildah) Pull(ctx context.Context, ref string, opts PullOpts) error

func (*NativeRootlessBuildah) Push

func (b *NativeRootlessBuildah) Push(ctx context.Context, ref string, opts PushOpts) error

func (*NativeRootlessBuildah) Rmi

func (b *NativeRootlessBuildah) Rmi(ctx context.Context, ref string, opts RmiOpts) error

func (*NativeRootlessBuildah) RunCommand

func (b *NativeRootlessBuildah) RunCommand(ctx context.Context, container string, command []string, opts RunCommandOpts) error

func (*NativeRootlessBuildah) Tag

func (b *NativeRootlessBuildah) Tag(_ context.Context, ref, newRef string, opts TagOpts) error

func (*NativeRootlessBuildah) Umount added in v1.2.46

func (b *NativeRootlessBuildah) Umount(ctx context.Context, container string, opts UmountOpts) error

type NativeRootlessModeOpts

type NativeRootlessModeOpts struct{}

type PullOpts

type PullOpts CommonOpts

type PushOpts

type PushOpts CommonOpts

type RmiOpts

type RmiOpts struct {
	CommonOpts
	Force bool
}

type RunCommandOpts

type RunCommandOpts struct {
	CommonOpts
	Args   []string
	Mounts []specs.Mount
}

type RunMount added in v1.2.46

type RunMount struct {
	Type        string
	TmpfsSize   string
	Source      string
	Destination string
}

type TagOpts

type TagOpts CommonOpts

type UmountOpts added in v1.2.46

type UmountOpts CommonOpts

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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