command

package
v20.10.7+incompatible Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: Apache-2.0 Imports: 47 Imported by: 4,906

Documentation

Index

Constants

View Source
const (
	// OrchestratorKubernetes orchestrator
	OrchestratorKubernetes = Orchestrator("kubernetes")
	// OrchestratorSwarm orchestrator
	OrchestratorSwarm = Orchestrator("swarm")
	// OrchestratorAll orchestrator
	OrchestratorAll = Orchestrator("all")
)
View Source
const (
	// DefaultContextName is the name reserved for the default context (config & env based)
	DefaultContextName = "default"
)

Variables

View Source
var (
	// NewInStream returns a new InStream object from a ReadCloser
	// Deprecated: Use github.com/docker/cli/cli/streams.NewIn instead
	NewInStream = streams.NewIn
	// NewOutStream returns a new OutStream object from a Writer
	// Deprecated: Use github.com/docker/cli/cli/streams.NewOut instead
	NewOutStream = streams.NewOut
)

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 BuildKitEnabled

func BuildKitEnabled(si ServerInfo) (bool, error)

BuildKitEnabled returns whether buildkit is enabled either through a daemon setting or otherwise the client-side DOCKER_BUILDKIT environment variable

func ConfigureAuth

func ConfigureAuth(cli Cli, flUser, flPassword string, authconfig *types.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 ElectAuthServer

func ElectAuthServer(ctx context.Context, cli Cli) string

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

func EncodeAuthToBase64

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

EncodeAuthToBase64 serializes the auth configuration as JSON base64 payload

func GetDefaultAuthConfig

func GetDefaultAuthConfig(cli Cli, checkCredStore bool, serverAddress string, isDefaultRegistry bool) (*types.AuthConfig, error)