client

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2016 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Overview

Package client provides a command-line interface for Docker.

Run "docker help SUBCOMMAND" or "docker SUBCOMMAND --help" to see more information on any Docker subcommand, including the full list of options supported for the subcommand. See https://docs.docker.com/installation/ for instructions on installing Docker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTrustedFlags added in v1.12.0

func AddTrustedFlags(fs *pflag.FlagSet, verify bool)

AddTrustedFlags adds content trust flags to the current command flagset

func CopyToFile added in v1.12.0

func CopyToFile(outfile string, r io.Reader) error

CopyToFile writes the content of the reader to the specified file

func EncodeAuthToBase64 added in v1.12.0

func EncodeAuthToBase64(authConfig types.AuthConfig) (string, error)

EncodeAuthToBase64 serializes the auth configuration as JSON base64 payload

func EraseCredentials added in v1.12.0

func EraseCredentials(c *configfile.ConfigFile, serverAddress string) error

EraseCredentials removes the user credentials from a credentials store. The store is determined by the config file settings.

func GetAllCredentials added in v1.12.0

func GetAllCredentials(c *configfile.ConfigFile) (map[string]types.AuthConfig, error)

GetAllCredentials loads all credentials from a credentials store. The store is determined by the config file settings.

func GetCredentials added in v1.12.0

func GetCredentials(c *configfile.ConfigFile, serverAddress string) (types.AuthConfig, error)

GetCredentials loads the user credentials from a credentials store. The store is determined by the config file settings.

func IsTrusted added in v1.12.0

func IsTrusted() bool

IsTrusted returns true if content trust is enabled

func LoadCredentialsStore added in v1.12.0

func LoadCredentialsStore(c *configfile.ConfigFile) credentials.Store

LoadCredentialsStore initializes a new credentials store based in the settings provided in the configuration file.

func LoadDefaultConfigFile added in v1.12.0

func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile

LoadDefaultConfigFile attempts to load the default config file and returns an initialized ConfigFile struct if none is found.

func NewAPIClientFromFlags added in v1.12.0

func NewAPIClientFromFlags(clientFlags *cliflags.ClientFlags, configFile *configfile.ConfigFile) (client.APIClient, error)

NewAPIClientFromFlags creates a new APIClient from command line flags

func ParseExec added in v1.10.0

func ParseExec(cmd *flag.FlagSet, args []string) (*types.ExecConfig, error)

ParseExec parses the specified args for the specified command and generates an ExecConfig from it. If the minimal number of specified args is not right or if specified args are not valid, it will return an error.

func PrettyPrint added in v1.12.0

func PrettyPrint(i interface{}) string

PrettyPrint outputs arbitrary data for human formatted output by uppercasing the first letter.

func StoreCredentials added in v1.12.0

func StoreCredentials(c *configfile.ConfigFile, auth types.AuthConfig) error

StoreCredentials saves the user credentials in a credentials store. The store is determined by the config file settings.

Types

type DockerCli

type DockerCli struct {
	// contains filtered or unexported fields
}

DockerCli represents the docker command line client. Instances of the client can be returned from NewDockerCli.

func NewDockerCli

func NewDockerCli(in io.ReadCloser, out, err io.Writer, clientFlags *cliflags.ClientFlags) *DockerCli

NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err. The key file, protocol (i.e. unix) and address are passed in as strings, along with the tls.Config. If the tls.Config is set the client scheme will be set to https. The client will be given a 32-second timeout (see https://github.com/docker/docker/pull/8035).

func (*DockerCli) CheckTtyInput added in v1.4.0

func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error

CheckTtyInput checks if we are trying to attach to a container tty from a non-tty client input stream, and if so, returns an error.

func (*DockerCli) Client added in v1.12.0

func (cli *DockerCli) Client() client.APIClient

Client returns the APIClient

func (*DockerCli) CmdExec added in v1.3.0

func (cli *DockerCli) CmdExec(args ...string) error

CmdExec runs a command in a running container.

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

func (*DockerCli) CmdInfo

func (cli *DockerCli) CmdInfo(args ...string) error

CmdInfo displays system-wide information.

Usage: docker info

func (*DockerCli) CmdInspect

func (cli *DockerCli) CmdInspect(args ...string) error

CmdInspect displays low-level information on one or more containers, images or tasks.

Usage: docker inspect [OPTIONS] CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...]

func (*DockerCli) CmdUpdate added in v1.10.0

func (cli *DockerCli) CmdUpdate(args ...string) error

CmdUpdate updates resources of one or more containers.

Usage: docker update [OPTIONS] CONTAINER [CONTAINER...]

func (*DockerCli) Command added in v1.12.0

func (cli *DockerCli) Command(name string) func(...string) error

Command returns a cli command handler if one exists

func (*DockerCli) ConfigFile added in v1.12.0

func (cli *DockerCli) ConfigFile() *configfile.ConfigFile

ConfigFile returns the ConfigFile

func (*DockerCli) ConfigureAuth added in v1.12.0

func (cli *DockerCli) ConfigureAuth(flUser, flPassword, serverAddress string, isDefaultRegistry bool) (types.AuthConfig, error)

ConfigureAuth returns an AuthConfig from the specified user, password and server.

func (*DockerCli) ElectAuthServer added in v1.12.0

func (cli *DockerCli) ElectAuthServer(ctx context.Context) string

ElectAuthServer returns the default registry to use (by asking the daemon)

func (*DockerCli) Err added in v1.7.0

func (cli *DockerCli) Err() io.Writer

Err returns the writer used for stderr

func (*DockerCli) ForwardAllSignals added in v1.12.0

func (cli *DockerCli) ForwardAllSignals(ctx context.Context, cid string) chan os.Signal

ForwardAllSignals forwards signals to the container TODO: this can be unexported again once all container commands are under api/client/container

func (*DockerCli) GetTtySize added in v1.12.0

func (cli *DockerCli) GetTtySize() (int, int)

GetTtySize returns the height and width in characters of the tty

func (*DockerCli) HoldHijackedConnection added in v1.12.0

func (cli *DockerCli) HoldHijackedConnection(ctx context.Context, tty bool, inputStream io.ReadCloser, outputStream, errorStream io.Writer, resp types.HijackedResponse) error

HoldHijackedConnection handles copying input to and output from streams to the connection

func (*DockerCli) ImagePullPrivileged added in v1.12.0

func (cli *DockerCli) ImagePullPrivileged(ctx context.Context, authConfig types.AuthConfig, ref string, requestPrivilege types.RequestPrivilegeFunc, all bool) error

ImagePullPrivileged pulls the image and displays it to the output

func (*DockerCli) ImagePushPrivileged added in v1.12.0

func (cli *DockerCli) ImagePushPrivileged(ctx context.Context, authConfig types.AuthConfig, ref string, requestPrivilege types.RequestPrivilegeFunc) (io.ReadCloser, error)

ImagePushPrivileged push the image

func (*DockerCli) ImagesFormat added in v1.10.0

func (cli *DockerCli) ImagesFormat() string

ImagesFormat returns the format string specified in the configuration. String contains columns and format specification, for example {{ID}}\t{{Name}}.

func (*DockerCli) In added in v1.12.0

func (cli *DockerCli) In() io.ReadCloser

In returns the reader used for stdin

func (*DockerCli) Initialize added in v1.8.0

func (cli *DockerCli) Initialize() error

Initialize calls the init function that will setup the configuration for the client such as the TLS, tcp and other parameters used to run the client.

func (*DockerCli) IsTerminalOut added in v1.12.0

func (cli *DockerCli) IsTerminalOut() bool

IsTerminalOut returns true if the clients stdin is a TTY

func (*DockerCli) MonitorTtySize added in v1.12.0

func (cli *DockerCli) MonitorTtySize(ctx context.Context, id string, isExec bool) error

MonitorTtySize updates the container tty size when the terminal tty changes size

func (*DockerCli) Out added in v1.7.0

func (cli *DockerCli) Out() io.Writer

Out returns the writer used for stdout

func (*DockerCli) OutFd added in v1.12.0

func (cli *DockerCli) OutFd() uintptr

OutFd returns the fd for the stdout stream

func (*DockerCli) PsFormat added in v1.8.0

func (cli *DockerCli) PsFormat() string

PsFormat returns the format string specified in the configuration. String contains columns and format specification, for example {{ID}}\t{{Name}}.

func (*DockerCli) RegistryAuthenticationPrivilegedFunc added in v1.12.0

func (cli *DockerCli) RegistryAuthenticationPrivilegedFunc(index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc

RegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info for the given command.

func (*DockerCli) ResizeTtyTo added in v1.12.0

func (cli *DockerCli) ResizeTtyTo(ctx context.Context, id string, height, width int, isExec bool)

ResizeTtyTo resizes tty to specific height and width TODO: this can be unexported again once all container related commands move to package container

func (*DockerCli) ResolveAuthConfig added in v1.12.0

func (cli *DockerCli) ResolveAuthConfig(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig

ResolveAuthConfig is like registry.ResolveAuthConfig, but if using the default index, it uses the default index name for the daemon's platform, not the client's platform.

func (*DockerCli) RetrieveAuthConfigs added in v1.12.0

func (cli *DockerCli) RetrieveAuthConfigs() map[string]types.AuthConfig

RetrieveAuthConfigs return all credentials.

func (*DockerCli) RetrieveAuthTokenFromImage added in v1.12.0

func (cli *DockerCli) RetrieveAuthTokenFromImage(ctx context.Context, image string) (string, error)

RetrieveAuthTokenFromImage retrieves an encoded auth token given a complete image

func (*DockerCli) TagTrusted added in v1.12.0

func (cli *DockerCli) TagTrusted(ctx context.Context, trustedRef reference.Canonical, ref reference.NamedTagged) error

TagTrusted tags a trusted ref

func (*DockerCli) TrustedPull added in v1.12.0

func (cli *DockerCli) TrustedPull(ctx context.Context, repoInfo *registry.RepositoryInfo, ref registry.Reference, authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error

TrustedPull handles content trust pulling of an image

func (*DockerCli) TrustedPush added in v1.12.0

func (cli *DockerCli) TrustedPush(ctx context.Context, repoInfo *registry.RepositoryInfo, ref reference.Named, authConfig types.AuthConfig, requestPrivilege types.RequestPrivilegeFunc) error

TrustedPush handles content trust pushing of an image

func (*DockerCli) TrustedReference added in v1.12.0

func (cli *DockerCli) TrustedReference(ctx context.Context, ref reference.NamedTagged) (reference.Canonical, error)

TrustedReference returns the canonical trusted reference for an image reference

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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