dockercmd

package
v0.0.0-...-40fbbb1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommandFromConfig

func BuildCommandFromConfig(commandName string, cfg *config.Configuration) (*exec.Cmd, error)

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 NewBuilder

func NewBuilder() *Builder

NewBuilder returns a new docker command builder

func (*Builder) AddArgument

func (b *Builder) AddArgument(argument string) *Builder

AddArgument adds arguments to the docker run command

func (*Builder) AddCmdArguments

func (b *Builder) AddCmdArguments(arguments []string) *Builder

AddCmdArguments adds command arguments that are applied to the command executed inside the container

func (*Builder) AddEnvVar

func (b *Builder) AddEnvVar(envVarDeclaration string) *Builder

AddEnvVar adds an environment variable to the docker-container. example: HOME=/home/myuser

func (*Builder) AddGroup

func (b *Builder) AddGroup(groupName string) *Builder

AddGroup adds the given group name into the docker container.

func (*Builder) AddPortMapping

func (b *Builder) AddPortMapping(hostPort string, containerPort string) *Builder

AddPortMapping adds a mapping of ports between the docker container and the host

func (*Builder) AddVolumeMapping

func (b *Builder) AddVolumeMapping(hostPath, containerPath, options string) *Builder

AddVolumeMapping adds a volulme mapping between the docker container and the host

func (*Builder) AttachTo

func (b *Builder) AttachTo(stream string) *Builder

AttachTo attaches Streams to the docker-container. possible values: STDERR, STDOUT, STDIN

func (*Builder) Build

func (b *Builder) Build() *exec.Cmd

Build builds the exec.Cmd which will start a docker-container

func (*Builder) SetContainerName

func (b *Builder) SetContainerName(containerName string) *Builder

SetContainerName sets the display name of the container

func (*Builder) SetContainerUserAndGroup

func (b *Builder) SetContainerUserAndGroup(userID string, groupID string) *Builder

SetContainerUserAndGroup sets the given userId:groupId as current user and group in the container

func (*Builder) SetEntryPoint

func (b *Builder) SetEntryPoint(entryPoint string) *Builder

SetEntryPoint sets the entry point for the docker run command

func (*Builder) SetImageName

func (b *Builder) SetImageName(imageName string) *Builder

SetImageName sets the image on which base the container is created

func (*Builder) SetNetwork

func (b *Builder) SetNetwork(network string) *Builder

SetNetwork connects the docker container to the given docker-network

func (*Builder) SetStdErr

func (b *Builder) SetStdErr(w io.Writer) *Builder

SetStdErr will be applied to the exec.Cmd

func (*Builder) SetStdIn

func (b *Builder) SetStdIn(r io.Reader) *Builder

SetStdIn will be applied to the exec.Cmd

func (*Builder) SetStdOut

func (b *Builder) SetStdOut(w io.Writer) *Builder

SetStdOut will be applied to the exec.Cmd

func (*Builder) SetWorkingDir

func (b *Builder) SetWorkingDir(workingDir string) *Builder

SetWorkingDir sets the default working dir for commands executed inside the container

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL