libdocker

package
v0.0.0-...-3ddbcea Latest Latest
Warning

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

Go to latest
Published: May 26, 2015 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInContainer

func RunInContainer(id string, options *DockerExecOptions) (int, error)

RunInContainer runs a process in a running docker container using the options specified. It returns the exit code and/or error.

Types

type Config

type Config struct {
	Hostname        string
	Domainname      string
	User            string
	AttachStdin     bool
	AttachStdout    bool
	AttachStderr    bool
	PortSpecs       []string // Deprecated - Can be in the format of 8080/tcp
	Tty             bool     // Attach standard streams to a tty, including stdin if it is not closed.
	OpenStdin       bool     // Open stdin
	StdinOnce       bool     // If true, close stdin after the 1 attached client disconnects.
	Env             []string
	Image           string // Name of the image as it was passed by the operator (eg. could be symbolic)
	Volumes         map[string]struct{}
	WorkingDir      string
	NetworkDisabled bool
	MacAddress      string
	OnBuild         []string
	Labels          map[string]string
}

type ContainerConfig

type ContainerConfig struct {
	State  `json:"State"`
	ID     string
	Path   string
	Args   []string
	Config Config `json:"Config"`
}

type DockerExecOptions

type DockerExecOptions struct {
	// The command to be run followed by any arguments.
	Args []string

	// Env specifies the environment variables for the process.
	Env []string

	// User will set the uid and gid of the executing process running inside the container
	// local to the container's user and group configuration.
	User string

	// Cwd will change the processes current working directory inside the container's rootfs.
	Cwd string

	// Stdin is a pointer to a reader which provides the standard input stream.
	Stdin io.Reader

	// Stdout is a pointer to a writer which receives the standard output stream.
	Stdout io.Writer

	// Stderr is a pointer to a writer which receives the standard error stream.
	Stderr io.Writer

	// Capabilities specify the capabilities to keep when executing the process inside the container.
	Capabilities []string

	// Tty specifies whether a tty should be allocated or not.
	Tty bool
}

type State

type State struct {
	Running    bool
	Paused     bool
	Restarting bool
	OOMKilled  bool
	Dead       bool
	Pid        int
	ExitCode   int
	Error      string // contains last known error when starting the container
}

The structs below this line are used for reading docker state

Jump to

Keyboard shortcuts

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