Documentation
¶
Index ¶
- Constants
- func DiffFormatWrite(fmtCtx formatter.Context, changes []container.FilesystemChange) errordeprecated
- 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.Commanddeprecated
- func NewCommitCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewContainerCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewCopyCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewCreateCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewDiffCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewDiffFormat(source string) formatter.Formatdeprecated
- func NewExecCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewExportCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewKillCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewLogsCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewPauseCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewPortCommand(dockerCli command.Cli) *cobra.Commanddeprecated
- func NewPruneCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewPsCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewRenameCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewRestartCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewRmCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewRunCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewStartCommand(dockerCli command.Cli) *cobra.Commanddeprecated
- func NewStatsCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewStatsFormat(source, osType string) formatter.Format
- func NewStopCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewTopCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewUnpauseCommand(dockerCli command.Cli) *cobra.Commanddeprecated
- func NewUpdateCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func NewWaitCommand(dockerCLI command.Cli) *cobra.Commanddeprecated
- func RunAttach(ctx context.Context, dockerCLI command.Cli, containerID string, ...) error
- func RunExec(ctx context.Context, dockerCLI command.Cli, containerIDorName string, ...) error
- func RunPrune(ctx context.Context, dockerCli command.Cli, _ bool, filter opts.FilterOpt) (uint64, string, error)
- func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) error
- func RunStats(ctx context.Context, dockerCLI command.Cli, options *StatsOptions) error
- type AttachOptions
- type ExecOptions
- type StartOptions
- type Stats
- type StatsEntry
- type StatsOptions
Constants ¶
const ( PullImageAlways = "always" PullImageMissing = "missing" // Default (matches previous behavior) PullImageNever = "never" )
Pull constants
Variables ¶
This section is empty.
Functions ¶
func DiffFormatWrite
deprecated
func DiffFormatWrite(fmtCtx formatter.Context, changes []container.FilesystemChange) error
DiffFormatWrite writes formatted diff using the Context
Deprecated: this function was only used internally and will be removed in the next release.
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
deprecated
func NewCommitCommand
deprecated
func NewContainerCommand
deprecated
func NewCopyCommand
deprecated
func NewCreateCommand
deprecated
func NewDiffCommand
deprecated
func NewDiffFormat
deprecated
func NewExecCommand
deprecated
func NewExportCommand
deprecated
func NewKillCommand
deprecated
func NewLogsCommand
deprecated
func NewPauseCommand
deprecated
func NewPortCommand
deprecated
func NewPruneCommand
deprecated
func NewPsCommand
deprecated
func NewRenameCommand
deprecated
func NewRestartCommand
deprecated
func NewRmCommand
deprecated
func NewRunCommand
deprecated
func NewStartCommand
deprecated
func NewStatsCommand
deprecated
NewStatsCommand creates a new cobra.Command for "docker stats".
Deprecated: Do not import commands directly. They will be removed in a future release.
func NewStatsFormat ¶
NewStatsFormat returns a format for rendering an CStatsContext
func NewStopCommand
deprecated
func NewTopCommand
deprecated
func NewUnpauseCommand
deprecated
func NewUpdateCommand
deprecated
func NewWaitCommand
deprecated
func RunAttach ¶
func RunAttach(ctx context.Context, dockerCLI command.Cli, containerID string, opts *AttachOptions) error
RunAttach executes an `attach` command
func RunExec ¶
func RunExec(ctx context.Context, dockerCLI command.Cli, containerIDorName string, options ExecOptions) error
RunExec executes an `exec` command
func RunPrune ¶
func RunPrune(ctx context.Context, dockerCli command.Cli, _ bool, filter opts.FilterOpt) (uint64, string, error)
RunPrune calls the Container Prune API This returns the amount of space reclaimed and a detailed output string
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
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 the statistics data collected from a container
type StatsOptions ¶
type StatsOptions struct {
// All allows including both running and stopped containers. The default
// is to only include running containers.
All bool
// NoStream disables streaming stats. If enabled, stats are collected once,
// and the result is printed.
NoStream bool
// NoTrunc disables truncating the output. The default is to truncate
// output such as container-IDs.
NoTrunc bool
// Format is a custom template to use for presenting the stats.
// Refer to [flagsHelper.FormatHelp] for accepted formats.
Format string
// Containers is the list of container names or IDs to include in the stats.
// If empty, all containers are included. It is mutually exclusive with the
// Filters option, and an error is produced if both are set.
Containers []string
// Filters provides optional filters to filter the list of containers and their
// associated container-events to include in the stats if no list of containers
// is set. If no filter is provided, all containers are included. Filters and
// Containers are currently mutually exclusive, and setting both options
// produces an error.
//
// These filters are used both to collect the initial list of containers and
// to refresh the list of containers based on container-events, accepted
// filters are limited to the intersection of filters accepted by "events"
// and "container list".
//
// Currently only "label" / "label=value" filters are accepted. Additional
// filter options may be added in future (within the constraints described
// above), but may require daemon-side validation as the list of accepted
// filters can differ between daemon- and API versions.
Filters *filters.Args
}
StatsOptions defines options for RunStats.
Source Files
¶
- attach.go
- auth_config_utils.go
- cmd.go
- commit.go
- completion.go
- cp.go
- create.go
- diff.go
- errors.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