buildah

package
v1.2.211 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 37 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

View Source
var DefaultShell = []string{"/bin/sh", "-c"}

Functions

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 AddOpts added in v1.2.178

type AddOpts struct {
	CommonOpts

	ContextDir string
	Chown      string
	Chmod      string
	Ignores    []string
}

type BuildFromCommandsOpts added in v1.2.178

type BuildFromCommandsOpts struct {
	CommonOpts
}

type BuildFromDockerfileOpts

type BuildFromDockerfileOpts struct {
	CommonOpts

	ContextDir string
	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 string, 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
	Copy(ctx context.Context, container, contextDir string, src []string, dst string, opts CopyOpts) error
	Add(ctx context.Context, container string, src []string, dst string, opts AddOpts) error
}

func NewBuildah

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

type BuildahOpts

type BuildahOpts struct {
	CommonBuildahOpts
	NativeModeOpts
}

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
	CmdPrependShell        bool
	Entrypoint             []string
	EntrypointPrependShell bool
	User                   string
	Workdir                string
	Healthcheck            *thirdparty.BuildahHealthConfig
	OnBuild                string
	StopSignal             string
	Shell                  []string
	Maintainer             string
}

type CopyOpts added in v1.2.178

type CopyOpts struct {
	CommonOpts

	Chown   string
	Chmod   string
	Ignores []string
}

type FromCommandOpts

type FromCommandOpts CommonOpts

type Mode

type Mode string
const (
	ModeAuto     Mode = "auto"
	ModeDisabled Mode = "disabled"
	ModeNative   Mode = "native"
)

type MountOpts added in v1.2.46

type MountOpts CommonOpts

type NativeBuildah added in v1.2.48

type NativeBuildah struct {
	Isolation               thirdparty.Isolation
	TmpDir                  string
	InstanceTmpDir          string
	ConfigTmpDir            string
	SignaturePolicyPath     string
	RegistriesConfigPath    string
	RegistriesConfigDirPath string
	Insecure                bool

	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) Add added in v1.2.178

func (b *NativeBuildah) Add(ctx context.Context, container string, src []string, dst string, opts AddOpts) error

func (*NativeBuildah) BuildFromDockerfile added in v1.2.48

func (b *NativeBuildah) BuildFromDockerfile(ctx context.Context, dockerfile string, 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) Copy added in v1.2.178

func (b *NativeBuildah) Copy(ctx context.Context, container, contextDir string, src []string, dst string, opts CopyOpts) 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) NewSessionTmpDir added in v1.2.178

func (b *NativeBuildah) NewSessionTmpDir() (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

	ContextDir       string
	PrependShell     bool
	Shell            []string
	AddCapabilities  []string
	DropCapabilities []string
	NetworkType      string
	WorkingDir       string
	User             string
	Envs             []string
	// Mounts as allowed to be passed from command line.
	GlobalMounts []*specs.Mount
	// Mounts as allowed in Dockerfile RUN --mount option. Have more restrictions than GlobalMounts (e.g. Source of bind-mount can't be outside of ContextDir or container root).
	RunMounts []*instructions.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