buildah

package
v1.2.132 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShmSize              = "65536k"
	DefaultSignaturePolicy      = `` /* 126-byte string literal not displayed */
	DefaultRegistriesConfig     = `unqualified-search-registries = ["docker.io"]`
	BuildahImage                = "registry.werf.io/werf/buildah:v1.22.3-1"
	BuildahStorageContainerName = "werf-buildah-storage"

	DefaultStorageDriver StorageDriver = StorageDriverOverlay
)
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 GetBasicBuildahCliArgs added in v1.2.50

func GetBasicBuildahCliArgs(driver StorageDriver) ([]string, error)

func GetDefaultIsolation added in v1.2.48

func GetDefaultIsolation() (thirdparty.Isolation, error)

func GetFuseOverlayfsOptions added in v1.2.50

func GetFuseOverlayfsOptions() ([]string, error)

func NativeProcessStartupHook added in v1.2.48

func NativeProcessStartupHook() bool

func NewNativeStoreOptions added in v1.2.48

func NewNativeStoreOptions(rootlessUID int, driver StorageDriver) (*thirdparty.StoreOptions, error)

func ProcessStartupHook

func ProcessStartupHook(mode Mode) (bool, error)

Types

type BaseBuildah

type BaseBuildah struct {
	Isolation               thirdparty.Isolation
	TmpDir                  string
	InstanceTmpDir          string
	ConfigTmpDir            string
	SignaturePolicyPath     string
	RegistriesConfigPath    string
	RegistriesConfigDirPath 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 {
	Isolation thirdparty.Isolation
	Insecure  bool
}

type BuildFromDockerfileOpts

type BuildFromDockerfileOpts struct {
	CommonOpts
	ContextTar io.Reader
	BuildArgs  map[string]string
	Target     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, image string, opts FromCommandOpts) (string, error)
	Pull(ctx context.Context, ref string, opts PullOpts) error
	Inspect(ctx context.Context, ref string) (*thirdparty.BuilderInfo, error)
	Rm(ctx context.Context, ref string, opts RmOpts) 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
	Commit(ctx context.Context, container string, opts CommitOpts) (string, error)
	Config(ctx context.Context, container string, opts ConfigOpts) error
}

func NewBuildah

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

type CommitOpts added in v1.2.81

type CommitOpts struct {
	CommonOpts
	Image string
}

type CommonBuildahOpts

type CommonBuildahOpts struct {
	Isolation     *thirdparty.Isolation
	StorageDriver *StorageDriver
	TmpDir        string
	Insecure      bool
}

type CommonOpts

type CommonOpts struct {
	LogWriter io.Writer
}

type ConfigOpts added in v1.2.81

type ConfigOpts struct {
	CommonOpts
	Labels      []string
	Volumes     []string
	Expose      []string
	Envs        map[string]string
	Cmd         []string
	Entrypoint  []string
	User        string
	Workdir     string
	Healthcheck string
}

type DockerWithFuseBuildah

type DockerWithFuseBuildah struct {
	BaseBuildah
	// contains filtered or unexported fields
}

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) Commit added in v1.2.81

func (b *DockerWithFuseBuildah) Commit(ctx context.Context, container string, opts CommitOpts) (string, error)

func (*DockerWithFuseBuildah) Config added in v1.2.81

func (b *DockerWithFuseBuildah) Config(ctx context.Context, container string, opts ConfigOpts) error

func (*DockerWithFuseBuildah) FromCommand

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

func (*DockerWithFuseBuildah) Inspect

TODO: 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) Rm added in v1.2.81

func (b *DockerWithFuseBuildah) Rm(ctx context.Context, ref string, opts RmOpts) 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"
	ModeDisabled       Mode = "disabled"
	ModeNative         Mode = "native"
	ModeDockerWithFuse Mode = "docker-with-fuse"
)

func ResolveMode

func ResolveMode(mode Mode) Mode

type MountOpts added in v1.2.46

type MountOpts CommonOpts

type NativeBuildah added in v1.2.48

type NativeBuildah struct {
	BaseBuildah

	Store                     storage.Store
	Runtime                   libimage.Runtime
	DefaultSystemContext      imgtypes.SystemContext
	DefaultCommonBuildOptions define.CommonBuildOptions
	// contains filtered or unexported fields
}

func NewNativeBuildah added in v1.2.48

func NewNativeBuildah(commonOpts CommonBuildahOpts, opts NativeModeOpts) (*NativeBuildah, error)

func (*NativeBuildah) BuildFromDockerfile added in v1.2.48

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

func (*NativeBuildah) Commit added in v1.2.81

func (b *NativeBuildah) Commit(ctx context.Context, container string, opts CommitOpts) (string, error)

func (*NativeBuildah) Config added in v1.2.81

func (b *NativeBuildah) Config(ctx context.Context, container string, opts ConfigOpts) error

func (*NativeBuildah) FromCommand added in v1.2.48

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

func (*NativeBuildah) Inspect added in v1.2.48

func (b *NativeBuildah) Inspect(ctx context.Context, ref string) (*thirdparty.BuilderInfo, error)

Inspect returns nil, nil if image not found.

func (*NativeBuildah) Mount added in v1.2.48

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

func (*NativeBuildah) Pull added in v1.2.48

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

func (*NativeBuildah) Push added in v1.2.48

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

func (*NativeBuildah) Rm added in v1.2.81

func (b *NativeBuildah) Rm(ctx context.Context, ref string, opts RmOpts) error

func (*NativeBuildah) Rmi added in v1.2.48

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

func (*NativeBuildah) RunCommand added in v1.2.48

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

func (*NativeBuildah) Tag added in v1.2.48

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

func (*NativeBuildah) Umount added in v1.2.48

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

type NativeModeOpts added in v1.2.48

type NativeModeOpts struct {
	Platform string
}

type PullOpts

type PullOpts CommonOpts

type PushOpts

type PushOpts CommonOpts

type RmOpts added in v1.2.81

type RmOpts 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 StorageDriver added in v1.2.48

type StorageDriver string
const (
	StorageDriverOverlay StorageDriver = "overlay"
	StorageDriverVFS     StorageDriver = "vfs"
)

type StoreOptions added in v1.2.48

type StoreOptions struct {
	GraphDriverName    string
	GraphDriverOptions []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