container

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT, MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonSocketLocations = []string{
	"/var/run/docker.sock",
	"/run/podman/podman.sock",
	"$HOME/.colima/docker.sock",
	"$XDG_RUNTIME_DIR/docker.sock",
	"$XDG_RUNTIME_DIR/podman/podman.sock",
	`\\.\pipe\docker_engine`,
	"$HOME/.docker/run/docker.sock",
}

Functions

func GetDockerClient

func GetDockerClient(ctx context.Context) (cli client.APIClient, err error)

func GetHostInfo

func GetHostInfo(ctx context.Context) (info types.Info, err error)

func ImageExistsLocally

func ImageExistsLocally(ctx context.Context, imageName, platform string) (bool, error)

ImageExistsLocally returns a boolean indicating if an image with the requested name, tag and architecture exists in the local docker image store

func LoadDockerAuthConfig

func LoadDockerAuthConfig(ctx context.Context, image string) (registry.AuthConfig, error)

func LoadDockerAuthConfigs

func LoadDockerAuthConfigs(ctx context.Context) map[string]registry.AuthConfig

func NewDockerBuildExecutor

func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor

NewDockerBuildExecutor function to create a run executor for the container

func NewDockerNetworkCreateExecutor

func NewDockerNetworkCreateExecutor(name string) common.Executor

func NewDockerNetworkRemoveExecutor

func NewDockerNetworkRemoveExecutor(name string) common.Executor

func NewDockerPullExecutor

func NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor

NewDockerPullExecutor function to create a run executor for the container

func NewDockerVolumeRemoveExecutor

func NewDockerVolumeRemoveExecutor(volumeName string, force bool) common.Executor

func RemoveImage

func RemoveImage(ctx context.Context, imageName string, force, pruneChildren bool) (bool, error)

RemoveImage removes image from local store, the function is used to run different container image architectures

func RunnerArch

func RunnerArch(ctx context.Context) string

Arch fetches values from docker info and translates architecture to GitHub actions compatible runner.arch values https://github.com/github/docs/blob/main/data/reusables/actions/runner-arch-description.md

Types

type Container

type Container interface {
	Create(capAdd, capDrop []string) common.Executor
	ConnectToNetwork(name string) common.Executor
	Copy(destPath string, files ...*FileEntry) common.Executor
	CopyTarStream(ctx context.Context, destPath string, tarStream io.Reader) error
	CopyDir(destPath, srcPath string, useGitIgnore bool) common.Executor
	GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error)
	Pull(forcePull bool) common.Executor
	Start(attach bool) common.Executor
	Exec(command []string, env map[string]string, user, workdir string) common.Executor
	UpdateFromEnv(srcPath