Documentation ¶
Index ¶
- func InArray(val interface{}, array interface{}) (exists bool, index int)
- func IsCIEnvironment() bool
- func IsDockerNative() bool
- func IsDockerToolbox() bool
- func IsMinGW() bool
- func IsPodman() bool
- type Container
- func (c *Container) AddAllEnvironmentVariables()
- func (c *Container) AddCacheMount(name string, sourcePath string, targetPath string)
- func (c *Container) AddCapability(capability string)
- func (c *Container) AddContainerPort(port ContainerPort)
- 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) DetectRuntime() string
- func (c *Container) GetDockerCommand() string
- func (c *Container) GetName() string
- func (c *Container) GetPodmanCommand() string
- func (c *Container) GetPullCommand(runtime string) (string, error)
- func (c *Container) GetRunCommand(runtime string) string
- func (c *Container) PullImage()
- func (c *Container) SetCommand(newCommand string)
- func (c *Container) SetCommandShell(newCommandShell string)
- func (c *Container) SetEntrypoint(newEntrypoint string)
- func (c *Container) SetImage(newImage string)
- func (c *Container) SetName(newName string)
- func (c *Container) SetUserArgs(newArgs string)
- func (c *Container) SetWorkingDirectory(newWorkingDirectory string)
- func (c *Container) StartContainer()
- type ContainerMount
- type ContainerPort
- type ContainerRuntime
- type EnvironmentProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDockerToolbox ¶
func IsDockerToolbox() bool
IsDockerToolbox returns true, if docker toolbox is used
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
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) AddCapability ¶ added in v0.6.0
AddCapability adds a capability to the container
func (*Container) AddContainerPort ¶
func (c *Container) AddContainerPort(port ContainerPort)
AddContainerPort publishes a port
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) DetectRuntime ¶ added in v0.6.0
DetectRuntime returns the first available container runtime
func (*Container) GetDockerCommand ¶ added in v0.6.0
GetDockerCommand renders the command needed the run the container using docker (native or toolbox)
func (*Container) GetPodmanCommand ¶ added in v0.6.0
GetPodmanCommand renders the command needed the run the container using podman
func (*Container) GetPullCommand ¶ added in v0.6.0
GetPullCommand gets the command to pull the required image
func (*Container) GetRunCommand ¶
GetRunCommand gets the run command for the specified container runtime
func (*Container) PullImage ¶ added in v0.6.0
func (c *Container) PullImage()
PullImage pulls the image for the container
func (*Container) SetCommand ¶
SetCommand sets the container command
func (*Container) SetCommandShell ¶
SetCommandShell sets the command shell
func (*Container) SetEntrypoint ¶
SetEntrypoint overwrites the default entrypoint
func (*Container) SetUserArgs ¶ added in v0.5.1
SetUserArgs allows the user to pass custom arguments to the container run command, for special cases in ci envs with service links / or similar
func (*Container) SetWorkingDirectory ¶
SetWorkingDirectory sets the working directory
func (*Container) StartContainer ¶
func (c *Container) StartContainer()
StartContainer starts the Container
type ContainerMount ¶
ContainerMount holds container volume mounts
type ContainerPort ¶
ContainerPort holds container ports
type ContainerRuntime ¶
type ContainerRuntime struct{}
ContainerRuntime
func (*ContainerRuntime) NewContainer ¶
func (cr *ContainerRuntime) NewContainer() *Container
NewContainer will get a new container struct to work with
type EnvironmentProperty ¶
EnvironmentProperty holds environment variables