Documentation ¶
Index ¶
- func BuildCommandFromConfig(commandName string, cfg *config.Configuration) (*exec.Cmd, error)
- type Builder
- func (b *Builder) AddArgument(argument string) *Builder
- func (b *Builder) AddCmdArguments(arguments []string) *Builder
- func (b *Builder) AddEnvVar(envVarDeclaration string) *Builder
- func (b *Builder) AddGroup(groupName string) *Builder
- func (b *Builder) AddPortMapping(hostPort string, containerPort string) *Builder
- func (b *Builder) AddVolumeMapping(hostPath, containerPath, options string) *Builder
- func (b *Builder) AttachTo(stream string) *Builder
- func (b *Builder) Build() *exec.Cmd
- func (b *Builder) SetContainerName(containerName string) *Builder
- func (b *Builder) SetContainerUserAndGroup(userID string, groupID string) *Builder
- func (b *Builder) SetEntryPoint(entryPoint string) *Builder
- func (b *Builder) SetImageName(imageName string) *Builder
- func (b *Builder) SetNetwork(network string) *Builder
- func (b *Builder) SetStdErr(w io.Writer) *Builder
- func (b *Builder) SetStdIn(r io.Reader) *Builder
- func (b *Builder) SetStdOut(w io.Writer) *Builder
- func (b *Builder) SetWorkingDir(workingDir string) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCommandFromConfig ¶
BuildCommandFromConfig builds a docker-run command on base of the given configuration
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder can be used to build a docker run command
func (*Builder) AddArgument ¶
AddArgument adds arguments to the docker run command
func (*Builder) AddCmdArguments ¶
AddCmdArguments adds command arguments that are applied to the command executed inside the container
func (*Builder) AddEnvVar ¶
AddEnvVar adds an environment variable to the docker-container. example: HOME=/home/myuser
func (*Builder) AddPortMapping ¶
AddPortMapping adds a mapping of ports between the docker container and the host
func (*Builder) AddVolumeMapping ¶
AddVolumeMapping adds a volulme mapping between the docker container and the host
func (*Builder) AttachTo ¶
AttachTo attaches Streams to the docker-container. possible values: STDERR, STDOUT, STDIN
func (*Builder) SetContainerName ¶
SetContainerName sets the display name of the container
func (*Builder) SetContainerUserAndGroup ¶
SetContainerUserAndGroup sets the given userId:groupId as current user and group in the container
func (*Builder) SetEntryPoint ¶
SetEntryPoint sets the entry point for the docker run command
func (*Builder) SetImageName ¶
SetImageName sets the image on which base the container is created
func (*Builder) SetNetwork ¶
SetNetwork connects the docker container to the given docker-network
func (*Builder) SetWorkingDir ¶
SetWorkingDir sets the default working dir for commands executed inside the container