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 ¶
- func AddTrustedFlags(fs *pflag.FlagSet, verify bool)
- func CopyToFile(outfile string, r io.Reader) error
- func EncodeAuthToBase64(authConfig types.AuthConfig) (string, error)
- func EraseCredentials(c *configfile.ConfigFile, serverAddress string) error
- func GetAllCredentials(c *configfile.ConfigFile) (map[string]types.AuthConfig, error)
- func GetCredentials(c *configfile.ConfigFile, serverAddress string) (types.AuthConfig, error)
- func IsTrusted() bool
- func LoadCredentialsStore(c *configfile.ConfigFile) credentials.Store
- func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile
- func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error)
- func PrettyPrint(i interface{}) string
- func StoreCredentials(c *configfile.ConfigFile, auth types.AuthConfig) error
- type DockerCli
- func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error
- func (cli *DockerCli) Client() client.APIClient
- func (cli *DockerCli) ConfigFile() *configfile.ConfigFile
- func (cli *DockerCli) ConfigureAuth(flUser, flPassword, serverAddress string, isDefaultRegistry bool) (types.AuthConfig, error)
- func (cli *DockerCli) ElectAuthServer(ctx context.Context) string
- func (cli *DockerCli) Err() io.Writer
- func (cli *DockerCli) ForwardAllSignals(ctx context.Context, cid string) chan os.Signal
- func (cli *DockerCli) GetExecExitCode(ctx context.Context, execID string) (bool, int, error)
- func (cli *DockerCli) GetTtySize() (int, int)
- func (cli *DockerCli) HoldHijackedConnection(ctx context.Context, tty bool, inputStream io.ReadCloser, ...) error
- func (cli *DockerCli) ImagePullPrivileged(ctx context.Context, authConfig types.AuthConfig, ref string, ...) error
- func (cli *DockerCli) ImagePushPrivileged(ctx context.Context, authConfig types.AuthConfig, ref string, ...) (io.ReadCloser, error)
- func (cli *DockerCli) In() io.ReadCloser
- func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error
- func (cli *DockerCli) IsTerminalIn() bool
- func (cli *DockerCli) IsTerminalOut() bool
- func (cli *DockerCli) MonitorTtySize(ctx context.Context, id string, isExec bool) error
- func (cli *DockerCli) Out() io.Writer
- func (cli *DockerCli) OutFd() uintptr
- func (cli *DockerCli) RegistryAuthenticationPrivilegedFunc(index *registrytypes.IndexInfo, cmdName string) types.RequestPrivilegeFunc
- func (cli *DockerCli) ResizeTtyTo(ctx context.Context, id string, height, width int, isExec bool)
- func (cli *DockerCli) ResolveAuthConfig(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig
- func (cli *DockerCli) RetrieveAuthConfigs() map[string]types.AuthConfig
- func (cli *DockerCli) RetrieveAuthTokenFromImage(ctx context.Context, image string) (string, error)
- func (cli *DockerCli) TagTrusted(ctx context.Context, trustedRef reference.Canonical, ref reference.NamedTagged) error
- func (cli *DockerCli) TrustedPull(ctx context.Context, repoInfo *registry.RepositoryInfo, ref registry.Reference, ...) error
- func (cli *DockerCli) TrustedPush(ctx context.Context, repoInfo *registry.RepositoryInfo, ref reference.Named, ...) error
- func (cli *DockerCli) TrustedReference(ctx context.Context, ref reference.NamedTagged) (reference.Canonical, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTrustedFlags ¶
AddTrustedFlags adds content trust flags to the current command flagset
func CopyToFile ¶
CopyToFile writes the content of the reader to the specified file
func EncodeAuthToBase64 ¶
func EncodeAuthToBase64(authConfig types.AuthConfig) (string, error)
EncodeAuthToBase64 serializes the auth configuration as JSON base64 payload
func EraseCredentials ¶
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 ¶
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 ¶
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 LoadCredentialsStore ¶
func LoadCredentialsStore(c *configfile.ConfigFile) credentials.Store
LoadCredentialsStore initializes a new credentials store based in the settings provided in the configuration file.
func LoadDefaultConfigFile ¶
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 ¶
func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error)
NewAPIClientFromFlags creates a new APIClient from command line flags
func PrettyPrint ¶
func PrettyPrint(i interface{}) string
PrettyPrint outputs arbitrary data for human formatted output by uppercasing the first letter.
func StoreCredentials ¶
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) *DockerCli
NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.
func (*DockerCli) CheckTtyInput ¶
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) ConfigFile ¶
func (cli *DockerCli) ConfigFile() *configfile.ConfigFile
ConfigFile returns the ConfigFile
func (*DockerCli) ConfigureAuth ¶
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 ¶
ElectAuthServer returns the default registry to use (by asking the daemon)
func (*DockerCli) ForwardAllSignals ¶
ForwardAllSignals forwards signals to the container TODO: this can be unexported again once all container commands are under api/client/container
func (*DockerCli) GetExecExitCode ¶
GetExecExitCode perform an inspect on the exec command. It returns the running state and the exit code.
func (*DockerCli) GetTtySize ¶
GetTtySize returns the height and width in characters of the tty
func (*DockerCli) HoldHijackedConnection ¶
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 ¶
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 ¶
func (cli *DockerCli) ImagePushPrivileged(ctx context.Context, authConfig types.AuthConfig, ref string, requestPrivilege types.RequestPrivilegeFunc) (io.ReadCloser, error)
ImagePushPrivileged push the image
func (*DockerCli) In ¶
func (cli *DockerCli) In() io.ReadCloser
In returns the reader used for stdin
func (*DockerCli) Initialize ¶
func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error
Initialize the dockerCli runs initialization that must happen after command line flags are parsed.
func (*DockerCli) IsTerminalIn ¶
IsTerminalIn returns true if the clients stdin is a TTY
func (*DockerCli) IsTerminalOut ¶
IsTerminalOut returns true if the clients stdout is a TTY
func (*DockerCli) MonitorTtySize ¶
MonitorTtySize updates the container tty size when the terminal tty changes size
func (*DockerCli) RegistryAuthenticationPrivilegedFunc ¶
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 ¶
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 ¶
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 ¶
func (cli *DockerCli) RetrieveAuthConfigs() map[string]types.AuthConfig
RetrieveAuthConfigs return all credentials.
func (*DockerCli) RetrieveAuthTokenFromImage ¶
RetrieveAuthTokenFromImage retrieves an encoded auth token given a complete image
func (*DockerCli) TagTrusted ¶
func (cli *DockerCli) TagTrusted(ctx context.Context, trustedRef reference.Canonical, ref reference.NamedTagged) error
TagTrusted tags a trusted ref
func (*DockerCli) TrustedPull ¶
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 ¶
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 ¶
func (cli *DockerCli) TrustedReference(ctx context.Context, ref reference.NamedTagged) (reference.Canonical, error)
TrustedReference returns the canonical trusted reference for an image reference