Documentation
¶
Index ¶
- Variables
- func GetDockerClient(ctx context.Context) (cli client.APIClient, err error)
- func GetHostInfo(ctx context.Context) (info types.Info, err error)
- func ImageExistsLocally(ctx context.Context, imageName, platform string) (bool, error)
- func LoadDockerAuthConfig(ctx context.Context, image string) (registry.AuthConfig, error)
- func LoadDockerAuthConfigs(ctx context.Context) map[string]registry.AuthConfig
- func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor
- func NewDockerNetworkCreateExecutor(name string) common.Executor
- func NewDockerNetworkRemoveExecutor(name string) common.Executor
- func NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor
- func NewDockerVolumeRemoveExecutor(volumeName string, force bool) common.Executor
- func RemoveImage(ctx context.Context, imageName string, force, pruneChildren bool) (bool, error)
- func RunnerArch(ctx context.Context) string
- type Container
- type ExecutionsEnvironment
- type ExitCodeError
- type FileEntry
- type HostEnvironment
- func (e *HostEnvironment) Close() common.Executor
- func (e *HostEnvironment) ConnectToNetwork(name string) common.Executor
- func (e *HostEnvironment) Copy(destPath string, files ...*FileEntry) common.Executor
- func (e *HostEnvironment) CopyDir(destPath, srcPath string, useGitIgnore bool) common.Executor
- func (e *HostEnvironment) CopyTarStream(ctx context.Context, destPath string, tarStream io.Reader) error
- func (e *HostEnvironment) Create(_, _ []string) common.Executor
- func (e *HostEnvironment) DefaultPathVariable() string
- func (e *HostEnvironment) Exec(command []string, env map[string]string, user, workdir string) common.Executor
- func (e *HostEnvironment) ExecWithCmdLine(command []string, cmdline string, env map[string]string, user, workdir string) common.Executor
- func (e *HostEnvironment) GetActPath() string
- func (e *HostEnvironment) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error)
- func (*HostEnvironment) GetPathVariableName() string
- func (e *HostEnvironment) GetRunnerContext(_ context.Context) map[string]any
- func (*HostEnvironment) IsEnvironmentCaseInsensitive() bool
- func (*HostEnvironment) JoinPathVariable(paths ...string) string
- func (e *HostEnvironment) Pull(_ bool) common.Executor
- func (e *HostEnvironment) Remove() common.Executor
- func (e *HostEnvironment) ReplaceLogWriter(stdout, _ io.Writer) (io.Writer, io.Writer)
- func (e *HostEnvironment) Start(_ bool) common.Executor
- func (e *HostEnvironment) ToContainerPath(path string) string
- func (e *HostEnvironment) UpdateFromEnv(srcPath string, env *map[string]string) common.Executor
- func (e *HostEnvironment) UpdateFromImageEnv(_ *map[string]string) common.Executor
- type LinuxContainerEnvironmentExtensions
- func (*LinuxContainerEnvironmentExtensions) DefaultPathVariable() string
- func (*LinuxContainerEnvironmentExtensions) GetActPath() string
- func (*LinuxContainerEnvironmentExtensions) GetPathVariableName() string
- func (*LinuxContainerEnvironmentExtensions) GetRunnerContext(ctx context.Context) map[string]any
- func (*LinuxContainerEnvironmentExtensions) IsEnvironmentCaseInsensitive() bool
- func (*LinuxContainerEnvironmentExtensions) JoinPathVariable(paths ...string) string
- func (*LinuxContainerEnvironmentExtensions) ToContainerPath(path string) string
- type NewContainerInput
- type NewDockerBuildExecutorInput
- type NewDockerPullExecutorInput
- type SocketAndHost
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 ImageExistsLocally ¶
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 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 NewDockerPullExecutor ¶
func NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor
NewDockerPullExecutor function to create a run executor for the container
func RemoveImage ¶
RemoveImage removes image from local store, the function is used to run different container image architectures
func RunnerArch ¶
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