command

package
v26.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 50 Imported by: 4,906

Documentation

Index

Constants

View Source
const (
	// DefaultContextName is the name reserved for the default context (config & env based)
	DefaultContextName = "default"

	// EnvOverrideContext is the name of the environment variable that can be
	// used to override the context to use. If set, it overrides the context
	// that's set in the CLI's configuration file, but takes no effect if the
	// "DOCKER_HOST" env-var is set (which takes precedence.
	EnvOverrideContext = "DOCKER_CONTEXT"
)

Variables

View Source
var ErrPromptTerminated = PromptError(errors.New("prompt terminated"))

Functions

func AddPlatformFlag

func AddPlatformFlag(flags *pflag.FlagSet, target *string)

AddPlatformFlag adds `platform` to a set of flags for API version 1.32 and later.

func AddTrustSigningFlags

func AddTrustSigningFlags(fs *pflag.FlagSet, v *bool, trusted bool)

AddTrustSigningFlags adds "signing" flags to the provided flagset

func AddTrustVerificationFlags

func AddTrustVerificationFlags(fs *pflag.FlagSet, v *bool, trusted bool)

AddTrustVerificationFlags adds content trust flags to the provided flagset

func ConfigureAuth

func ConfigureAuth(cli Cli, flUser, flPassword string, authconfig *registrytypes.AuthConfig, isDefaultRegistry bool) error

ConfigureAuth handles prompting of user's username and password if needed

func CopyToFile

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

CopyToFile writes the content of the reader to the specified file

func DefaultContextStoreConfig

func DefaultContextStoreConfig() store.Config

DefaultContextStoreConfig returns a new store.Config with the default set of endpoints configured.

func GetDefaultAuthConfig

func GetDefaultAuthConfig(cfg *configfile.ConfigFile, checkCredStore bool, serverAddress string, isDefaultRegistry bool) (registrytypes.AuthConfig, error)

GetDefaultAuthConfig gets the default auth config given a serverAddress If credentials for given serverAddress exists in the credential store, the configuration will be populated with values in it

func NewAPIClientFromFlags

func NewAPIClientFromFlags(opts *cliflags.ClientOptions, configFile *configfile.ConfigFile) (client.APIClient, error)

NewAPIClientFromFlags creates a new APIClient from command line flags

func PrettyPrint

func PrettyPrint(i any) string

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

func