Documentation ¶
Index ¶
- Constants
- func DiffFormatWrite(ctx formatter.Context, changes []container.FilesystemChange) error
- func ForwardAllSignals(ctx context.Context, apiClient client.ContainerAPIClient, cid string, ...)
- func MonitorTtySize(ctx context.Context, cli command.Cli, id string, isExec bool) error
- func NewAttachCommand(dockerCli command.Cli) *cobra.Command
- func NewCommitCommand(dockerCli command.Cli) *cobra.Command
- func NewContainerCommand(dockerCli command.Cli) *cobra.Command
- func NewCopyCommand(dockerCli command.Cli) *cobra.Command
- func NewCreateCommand(dockerCli command.Cli) *cobra.Command
- func NewDiffCommand(dockerCli command.Cli) *cobra.Command
- func NewDiffFormat(source string) formatter.Format
- func NewExecCommand(dockerCli command.Cli) *cobra.Command
- func NewExportCommand(dockerCli command.Cli) *cobra.Command
- func NewKillCommand(dockerCli command.Cli) *cobra.Command
- func NewLogsCommand(dockerCli command.Cli) *cobra.Command
- func NewPauseCommand(dockerCli command.Cli) *cobra.Command
- func NewPortCommand(dockerCli command.Cli) *cobra.Command
- func NewPruneCommand(dockerCli command.Cli) *cobra.Command
- func NewPsCommand(dockerCli command.Cli) *cobra.Command
- func NewRenameCommand(dockerCli command.Cli) *cobra.Command
- func NewRestartCommand(dockerCli command.Cli) *cobra.Command
- func NewRmCommand(dockerCli command.Cli) *cobra.Command
- func NewRunCommand(dockerCli command.Cli) *cobra.Command
- func NewStartCommand(dockerCli command.Cli) *cobra.Command
- func NewStatsCommand(dockerCli command.Cli) *cobra.Command
- func NewStatsFormat(source, osType string) formatter.Format
- func NewStopCommand(dockerCli command.Cli) *cobra.Command
- func NewTopCommand(dockerCli command.Cli) *cobra.Command
- func NewUnpauseCommand(dockerCli command.Cli) *cobra.Command
- func NewUpdateCommand(dockerCli command.Cli) *cobra.Command
- func NewWaitCommand(dockerCli command.Cli) *cobra.Command
- func RunAttach(ctx context.Context, dockerCli command.Cli, target string, opts *AttachOptions) error
- func RunExec(ctx context.Context, dockerCli command.Cli, container string, ...) error
- func RunPrune(dockerCli command.Cli, _ bool, filter opts.FilterOpt) (uint64, string, error)
- func RunStart(dockerCli command.Cli, opts *StartOptions) error
- type AttachOptions
- type ExecOptions
- type StartOptions
- func NewStartOptions() StartOptionsdeprecated
- type Stats
- type StatsEntry
Constants ¶
const ( PullImageAlways = "always" PullImageMissing = "missing" // Default (matches previous behavior) PullImageNever = "never" )
Pull constants
Variables ¶
This section is empty.
Functions ¶
func DiffFormatWrite ¶
func DiffFormatWrite(ctx formatter.Context, changes []container.FilesystemChange) error
DiffFormatWrite writes formatted diff using the Context
func ForwardAllSignals ¶
func ForwardAllSignals(ctx context.Context, apiClient client.ContainerAPIClient, cid string, sigc <-chan os.Signal)
ForwardAllSignals forwards signals to the container
The channel you pass in must already be setup to receive any signals you want to forward.
func MonitorTtySize ¶
MonitorTtySize updates the container tty size when the terminal tty changes size
func NewAttachCommand ¶
NewAttachCommand creates a new cobra.Command for `docker attach`
func NewCommitCommand ¶
NewCommitCommand creates a new cobra.Command for `docker commit`
func NewContainerCommand ¶
NewContainerCommand returns a cobra command for `container` subcommands
func NewCopyCommand ¶
NewCopyCommand creates a new `docker cp` command
func NewCreateCommand ¶
NewCreateCommand creates a new cobra.Command for `docker create`
func NewDiffCommand ¶
NewDiffCommand creates a new cobra.Command for `docker diff`
func NewDiffFormat ¶
NewDiffFormat returns a format for use with a diff Context
func NewExecCommand ¶
NewExecCommand creates a new cobra.Command for `docker exec`
func NewExportCommand ¶
NewExportCommand creates a new `docker export` command
func NewKillCommand ¶
NewKillCommand creates a new cobra.Command for `docker kill`
func NewLogsCommand ¶
NewLogsCommand creates a new cobra.Command for `docker logs`
func NewPauseCommand ¶
NewPauseCommand creates a new cobra.Command for `docker pause`
func NewPortCommand ¶
NewPortCommand creates a new cobra.Command for `docker port`
func NewPruneCommand ¶
NewPruneCommand returns a new cobra prune command for containers
func NewPsCommand ¶
NewPsCommand creates a new cobra.Command for `docker ps`
func NewRenameCommand ¶
NewRenameCommand creates a new cobra.Command for `docker rename`
func NewRestartCommand ¶
NewRestartCommand creates a new cobra.Command for `docker restart`
func NewRmCommand ¶
NewRmCommand creates a new cobra.Command for `docker rm`
func NewRunCommand ¶
NewRunCommand create a new `docker run` command
func NewStartCommand ¶
NewStartCommand creates a new cobra.Command for `docker start`
func NewStatsCommand ¶
NewStatsCommand creates a new cobra.Command for `docker stats`
func NewStatsFormat ¶
NewStatsFormat returns a format for rendering an CStatsContext
func NewStopCommand ¶
NewStopCommand creates a new cobra.Command for `docker stop`
func NewTopCommand ¶
NewTopCommand creates a new cobra.Command for `docker top`
func NewUnpauseCommand ¶
NewUnpauseCommand creates a new cobra.Command for `docker unpause`
func NewUpdateCommand ¶
NewUpdateCommand creates a new cobra.Command for `docker update`
func NewWaitCommand ¶
NewWaitCommand creates a new cobra.Command for `docker wait`
func RunAttach ¶
func RunAttach(ctx context.Context, dockerCli command.Cli, target string, opts *AttachOptions) error
RunAttach executes an `attach` command
func RunExec ¶
func RunExec(ctx context.Context, dockerCli command.Cli, container string, options ExecOptions) error
RunExec executes an `exec` command
Types ¶
type AttachOptions ¶
AttachOptions group options for `attach` command
type ExecOptions ¶
type ExecOptions struct { DetachKeys string Interactive bool TTY bool Detach bool User string Privileged bool Env opts.ListOpts Workdir string Command []string EnvFile opts.ListOpts }
ExecOptions group options for `exec` command
type StartOptions ¶
type StartOptions struct { Attach bool OpenStdin bool DetachKeys string Checkpoint string CheckpointDir string Containers []string }
StartOptions group options for `start` command
func NewStartOptions
deprecated
func NewStartOptions() StartOptions
NewStartOptions creates a new StartOptions.
Deprecated: create a new StartOptions directly.
type Stats ¶
type Stats struct { StatsEntry // contains filtered or unexported fields }
Stats represents an entity to store containers statistics synchronously
func (*Stats) GetError ¶
GetError returns the container statistics error. This is used to determine whether the statistics are valid or not
func (*Stats) GetStatistics ¶
func (cs *Stats) GetStatistics() StatsEntry
GetStatistics returns container statistics with other meta data such as the container name
func (*Stats) SetErrorAndReset ¶
SetErrorAndReset zeroes all the container statistics and store the error. It is used when receiving time out error during statistics collecting to reduce lock overhead
func (*Stats) SetStatistics ¶
func (cs *Stats) SetStatistics(s StatsEntry)
SetStatistics set the container statistics
type StatsEntry ¶
type StatsEntry struct { Container string Name string ID string CPUPercentage float64 Memory float64 // On Windows this is the private working set MemoryLimit float64 // Not used on Windows MemoryPercentage float64 // Not used on Windows NetworkRx float64 NetworkTx float64 BlockRead float64 BlockWrite float64 PidsCurrent uint64 // Not used on Windows IsInvalid bool }
StatsEntry represents represents the statistics data collected from a container
Source Files ¶
- attach.go
- cmd.go
- commit.go
- cp.go
- create.go
- diff.go
- exec.go
- export.go
- formatter_diff.go
- formatter_stats.go
- hijack.go
- inspect.go
- kill.go
- list.go
- logs.go
- opts.go
- pause.go
- port.go
- prune.go
- rename.go
- restart.go
- rm.go
- run.go
- signals.go
- signals_unix.go
- start.go
- stats.go
- stats_helpers.go
- stop.go
- top.go
- tty.go
- unpause.go
- update.go
- utils.go
- wait.go