Documentation ¶
Index ¶
- 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 string, platform string) (bool, error)
- func LoadDockerAuthConfig(ctx context.Context, image string) (types.AuthConfig, error)
- func LoadDockerAuthConfigs(ctx context.Context) map[string]types.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(volume string, force bool) common.Executor
- func RemoveImage(ctx context.Context, imageName string, force bool, pruneChildren bool) (bool, error)
- func RunnerArch(ctx context.Context) string
- type Container
- type ExecutionsEnvironment
- 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 string, srcPath string, useGitIgnore bool) common.Executor
- func (e *HostEnvironment) Create(capAdd []string, capDrop []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) GetActPath() string
- func (e *HostEnvironment) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error)
- func (*HostEnvironment) GetPathVariableName() string
- func (e *HostEnvironment) GetRunnerContext(ctx context.Context) map[string]interface{}
- func (*HostEnvironment) IsEnvironmentCaseInsensitive() bool
- func (*HostEnvironment) JoinPathVariable(paths ...string) string
- func (e *HostEnvironment) Pull(forcePull bool) common.Executor
- func (e *HostEnvironment) Remove() common.Executor
- func (e *HostEnvironment) ReplaceLogWriter(stdout io.Writer, stderr io.Writer) (io.Writer, io.Writer)
- func (e *HostEnvironment) Start(attach 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(env *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]interface{}
- func (*LinuxContainerEnvironmentExtensions) IsEnvironmentCaseInsensitive() bool
- func (*LinuxContainerEnvironmentExtensions) JoinPathVariable(paths ...string) string
- func (*LinuxContainerEnvironmentExtensions) ToContainerPath(path string) string
- type NewContainerInput
- type NewDockerBuildExecutorInput
- type NewDockerPullExecutorInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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]types.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 ¶
func RemoveImage(ctx context.Context, imageName string, force bool, pruneChildren bool) (bool, error)
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 []string, capDrop []string) common.Executor ConnectToNetwork(name string) common.Executor Copy(destPath string, files ...*FileEntry) common.Executor CopyDir(destPath string, 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 string, env *map[string]string) common.Executor UpdateFromImageEnv(env *map[string]string) common.Executor Remove() common.Executor Close() common.Executor ReplaceLogWriter(io.Writer, io.Writer) (io.Writer, io.Writer) }
Container for managing docker run containers
type ExecutionsEnvironment ¶
type ExecutionsEnvironment interface { Container ToContainerPath(string) string GetActPath() string GetPathVariableName() string DefaultPathVariable() string JoinPathVariable(...string) string GetRunnerContext(ctx context.Context) map[string]interface{} // On windows PATH and Path are the same key IsEnvironmentCaseInsensitive() bool }
func NewContainer ¶
func NewContainer(input *NewContainerInput) ExecutionsEnvironment
NewContainer creates a reference to a container
type HostEnvironment ¶
type HostEnvironment struct { Path string TmpDir string ToolCache string Workdir string ActPath string CleanUp func() StdOut io.Writer }
func (*HostEnvironment) Close ¶
func (e *HostEnvironment) Close() common.Executor
func (*HostEnvironment) ConnectToNetwork ¶
func (e *HostEnvironment) ConnectToNetwork(name string) common.Executor
func (*HostEnvironment) Copy ¶
func (e *HostEnvironment) Copy(destPath string, files ...*FileEntry) common.Executor
func (*HostEnvironment) Create ¶
func (e *HostEnvironment) Create(capAdd []string, capDrop []string) common.Executor
func (*HostEnvironment) DefaultPathVariable ¶
func (e *HostEnvironment) DefaultPathVariable() string
func (*HostEnvironment) GetActPath ¶
func (e *HostEnvironment) GetActPath() string
func (*HostEnvironment) GetContainerArchive ¶
func (e *HostEnvironment) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error)
func (*HostEnvironment) GetPathVariableName ¶
func (*HostEnvironment) GetPathVariableName() string
func (*HostEnvironment) GetRunnerContext ¶
func (e *HostEnvironment) GetRunnerContext(ctx context.Context) map[string]interface{}
func (*HostEnvironment) IsEnvironmentCaseInsensitive ¶
func (*HostEnvironment) IsEnvironmentCaseInsensitive() bool
func (*HostEnvironment) JoinPathVariable ¶
func (*HostEnvironment) JoinPathVariable(paths ...string) string
func (*HostEnvironment) Remove ¶
func (e *HostEnvironment) Remove() common.Executor
func (*HostEnvironment) ReplaceLogWriter ¶
func (*HostEnvironment) ToContainerPath ¶
func (e *HostEnvironment) ToContainerPath(path string) string
func (*HostEnvironment) UpdateFromEnv ¶
func (*HostEnvironment) UpdateFromImageEnv ¶
func (e *HostEnvironment) UpdateFromImageEnv(env *map[string]string) common.Executor
type LinuxContainerEnvironmentExtensions ¶
type LinuxContainerEnvironmentExtensions struct { }
func (*LinuxContainerEnvironmentExtensions) DefaultPathVariable ¶
func (*LinuxContainerEnvironmentExtensions) DefaultPathVariable() string
func (*LinuxContainerEnvironmentExtensions) GetActPath ¶
func (*LinuxContainerEnvironmentExtensions) GetActPath() string
func (*LinuxContainerEnvironmentExtensions) GetPathVariableName ¶
func (*LinuxContainerEnvironmentExtensions) GetPathVariableName() string
func (*LinuxContainerEnvironmentExtensions) GetRunnerContext ¶
func (*LinuxContainerEnvironmentExtensions) GetRunnerContext(ctx context.Context) map[string]interface{}
func (*LinuxContainerEnvironmentExtensions) IsEnvironmentCaseInsensitive ¶
func (*LinuxContainerEnvironmentExtensions) IsEnvironmentCaseInsensitive() bool
func (*LinuxContainerEnvironmentExtensions) JoinPathVariable ¶
func (*LinuxContainerEnvironmentExtensions) JoinPathVariable(paths ...string) string
func (*LinuxContainerEnvironmentExtensions) ToContainerPath ¶
func (*LinuxContainerEnvironmentExtensions) ToContainerPath(path string) string
Resolves the equivalent host path inside the container This is required for windows and WSL 2 to translate things like C:\Users\Myproject to /mnt/users/Myproject For use in docker volumes and binds
type NewContainerInput ¶
type NewContainerInput struct { Image string Username string Password string Entrypoint []string Cmd []string WorkingDir string Env []string Binds []string Mounts map[string]string Name string Stdout io.Writer Stderr io.Writer NetworkMode string Privileged bool UsernsMode string Platform string Options string // Gitea specific AutoRemove bool NetworkAliases []string ValidVolumes []string }
NewContainerInput the input for the New function