Documentation ¶
Index ¶
- func IsDockerNative() bool
- func IsPodman() bool
- func ToUnixPath(path string) string
- type Container
- func (c *Container) AddAllEnvironmentVariables()
- func (c *Container) AddCacheMount(name string, sourcePath string, targetPath string)
- func (c *Container) AddContainerPorts(ports []string)
- func (c *Container) AddEnvironmentVariable(name string, value string)
- func (c *Container) AddEnvironmentVariables(variables []string)
- func (c *Container) AddVolume(mount ContainerMount)
- func (c *Container) AllowContainerRuntimeAcccess()
- func (c *Container) AutoTerminalParameters()
- func (c *Container) DetectRuntime() string
- func (c *Container) GetDockerCommand() string
- func (c *Container) GetPodmanCommand() string
- func (c *Container) GetPullCommand(runtime string) (string, error)
- func (c *Container) GetRunCommand(runtime string) (string, error)
- func (c *Container) PullImage() error
- func (c *Container) StartContainer() error
- type ContainerMount
- type ContainerPort
- type EnvironmentProperty
- type MountMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDockerNative ¶
func IsDockerNative() bool
IsDockerNative checks if docker is available in the PATH
func ToUnixPath ¶
ToUnixPath turns a windows path into a unix path
Types ¶
type Container ¶
type Container struct { Name string Image string Entrypoint *string CommandShell string Command string WorkingDirectory string Volumes []ContainerMount Environment []EnvironmentProperty ContainerPorts []ContainerPort Capabilities []string User string UserArgs string Privileged bool Interactive bool TTY bool }
Container provides all methods to interact with the container runtime
func (*Container) AddAllEnvironmentVariables ¶
func (c *Container) AddAllEnvironmentVariables()
AddAllEnvironmentVariables adds all environment variables, but filters a few irrelevant ones (like PATH, HOME, etc.)
func (*Container) AddCacheMount ¶
AddCacheMount adds a cache mount to the container
func (*Container) AddContainerPorts ¶
AddContainerPorts adds multiple published ports
func (*Container) AddEnvironmentVariable ¶
AddEnvironmentVariable adds a environment variable
func (*Container) AddEnvironmentVariables ¶
AddEnvironmentVariables adds multiple environment variables
func (*Container) AddVolume ¶
func (c *Container) AddVolume(mount ContainerMount)
AddVolume mounts a directory into a container
func (*Container) AllowContainerRuntimeAcccess ¶
func (c *Container) AllowContainerRuntimeAcccess()
AllowContainerRuntimeAcccess allows the container to access the container runtime
func (*Container) AutoTerminalParameters ¶
func (c *Container) AutoTerminalParameters()
AutoTerminalParameters automatically sets the terminal parameters
func (*Container) DetectRuntime ¶
DetectRuntime returns the first available container runtime
func (*Container) GetDockerCommand ¶
GetDockerCommand renders the command needed the run the container using docker
func (*Container) GetPodmanCommand ¶
GetPodmanCommand renders the command needed the run the container using podman
func (*Container) GetPullCommand ¶
GetPullCommand gets the command to pull the required image
func (*Container) GetRunCommand ¶
GetRunCommand gets the run command for the specified container runtime
func (*Container) StartContainer ¶
StartContainer starts the Container
type ContainerMount ¶
ContainerMount holds container volume mounts
type ContainerPort ¶
ContainerPort holds container ports
type EnvironmentProperty ¶
EnvironmentProperty holds environment variables