Documentation ¶
Overview ¶
Package container provides utilities for interacting with containers.
Index ¶
- Variables
- type BuilderFactory
- func (f *BuilderFactory) AddToBuilder(srcPath, destPath, chown string) error
- func (f *BuilderFactory) BuildImageFromGitRepo(ctx context.Context, gitCtx builder.GitContext, imageName string) error
- func (f *BuilderFactory) Changed() bool
- func (f *BuilderFactory) ExecuteCmdInBuilder(command []string) (string, error)
- func (f *BuilderFactory) GenerateImageHash() (string, error)
- func (f *BuilderFactory) ImageNameFrom() string
- func (f *BuilderFactory) PushBuilderImage(ctx context.Context, imageName string) error
- func (f *BuilderFactory) ReadFileFromBuilder(filePath string) ([]byte, error)
- func (f *BuilderFactory) SetEnvVar(name, value string) error
- func (f *BuilderFactory) SetUser(user string) error
- type Error
Constants ¶
This section is empty.
Variables ¶
var ( ErrCreatingDockerClient = errors.New("CreatingDockerClient", "failed to create docker client") ErrFailedToCreateContextDir = errors.New("FailedToCreateContextDir", "failed to create context directory") ErrNoImageNameProvided = errors.New("NoImageNameProvided", "no image name provided, push before reading") ErrFailedToCreateContainer = errors.New("FailedToCreateContainer", "failed to create container") ErrFailedToStopContainer = errors.New("FailedToStopContainer", "failed to stop container") ErrFailedToRemoveContainer = errors.New("FailedToRemoveContainer", "failed to remove container") ErrFailedToStartContainer = errors.New("FailedToStartContainer", "failed to start container") ErrFailedToCopyFileFromContainer = errors.New("FailedToCopyFileFromContainer", "failed to copy file from container") ErrFailedToReadFromTar = errors.New("FailedToReadFromTar", "failed to read from tar") ErrFailedToReadFileFromTar = errors.New("FailedToReadFileFromTar", "failed to read file from tar") ErrFileNotFoundInTar = errors.New("FileNotFoundInTar", "file not found in tar") ErrFailedToWriteDockerfile = errors.New("FailedToWriteDockerfile", "failed to write Dockerfile") ErrFailedToGetBuildContext = errors.New("FailedToGetBuildContext", "failed to get build context") ErrFailedToGetDefaultCacheOptions = errors.New("FailedToGetDefaultCacheOptions", "failed to get default cache options") ErrHashingDockerfile = errors.New("HashingDockerfile", "error hashing Dockerfile content") ErrReadingFile = errors.New("ReadingFile", "error reading file: %s") ErrHashingFile = errors.New("HashingFile", "error hashing file %s") ErrHashingBuildContext = errors.New("HashingBuildContext", "error hashing build context") )
Functions ¶
This section is empty.
Types ¶
type BuilderFactory ¶ added in v0.3.0
type BuilderFactory struct {
// contains filtered or unexported fields
}
BuilderFactory is responsible for creating new instances of buildah.Builder
func NewBuilderFactory ¶ added in v0.3.0
func NewBuilderFactory(imageName, buildContext string, imageBuilder builder.Builder) (*BuilderFactory, error)
NewBuilderFactory creates a new instance of BuilderFactory.
func (*BuilderFactory) AddToBuilder ¶ added in v0.7.0
func (f *BuilderFactory) AddToBuilder(srcPath, destPath, chown string) error
AddToBuilder adds a file from the source path to the destination path in the image, with the specified ownership.
func (*BuilderFactory) BuildImageFromGitRepo ¶ added in v0.11.0
func (f *BuilderFactory) BuildImageFromGitRepo(ctx context.Context, gitCtx builder.GitContext, imageName string) error
BuildImageFromGitRepo builds an image from the given git repository and pushes it to a registry. The image is identified by the provided name.
func (*BuilderFactory) Changed ¶ added in v0.7.0
func (f *BuilderFactory) Changed() bool
Changed returns true if the builder has been modified, false otherwise.
func (*BuilderFactory) ExecuteCmdInBuilder ¶ added in v0.3.0
func (f *BuilderFactory) ExecuteCmdInBuilder(command []string) (string, error)
ExecuteCmdInBuilder runs the provided command in the context of the given builder. It returns the command's output or any error encountered.
func (*BuilderFactory) GenerateImageHash ¶ added in v0.13.1
func (f *BuilderFactory) GenerateImageHash() (string, error)
GenerateImageHash creates a hash value based on the contents of the Dockerfile instructions and all files in the build context.
func (*BuilderFactory) ImageNameFrom ¶ added in v0.7.0
func (f *BuilderFactory) ImageNameFrom() string
ImageNameFrom returns the name of the image from which the builder is created.
func (*BuilderFactory) PushBuilderImage ¶ added in v0.3.0
func (f *BuilderFactory) PushBuilderImage(ctx context.Context, imageName string) error
PushBuilderImage pushes the image from the given builder to a registry. The image is identified by the provided name.
func (*BuilderFactory) ReadFileFromBuilder ¶ added in v0.3.0
func (f *BuilderFactory) ReadFileFromBuilder(filePath string) ([]byte, error)
ReadFileFromBuilder reads a file from the given builder's mount point. It returns the file's content or any error encountered.
func (*BuilderFactory) SetEnvVar ¶ added in v0.3.0
func (f *BuilderFactory) SetEnvVar(name, value string) error
SetEnvVar sets the value of an environment variable in the builder.
func (*BuilderFactory) SetUser ¶ added in v0.7.0
func (f *BuilderFactory) SetUser(user string) error
SetUser sets the user in the builder.