Documentation
¶
Index ¶
- Constants
- func Adapt(fn Command) func(cmd *cobra.Command, args []string) error
- func AdaptCmd(fn CobraCommand) func(cmd *cobra.Command, args []string) error
- func HooksCommand() *cobra.Command
- func RootCommand(dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command
- func RunningAsStandalone() bool
- type BackendOptions
- type CobraCommand
- type Command
- type ProjectFunc
- type ProjectOptions
- func (o *ProjectOptions) ToModel(ctx context.Context, dockerCli command.Cli, services []string, ...) (map[string]any, error)
- func (o *ProjectOptions) ToProject(ctx context.Context, dockerCli command.Cli, backend api.Compose, ...) (*types.Project, tracing.Metrics, error)
- func (o *ProjectOptions) WithProject(fn ProjectFunc, dockerCli command.Cli) func(cmd *cobra.Command, args []string) error
- func (o *ProjectOptions) WithServices(dockerCli command.Cli, fn ProjectServicesFunc) func(cmd *cobra.Command, args []string) error
- type ProjectServicesFunc
Constants ¶
const ( // ComposeParallelLimit set the limit running concurrent operation on docker engine ComposeParallelLimit = "COMPOSE_PARALLEL_LIMIT" // ComposeProjectName define the project name to be used, instead of guessing from parent directory ComposeProjectName = "COMPOSE_PROJECT_NAME" // ComposeCompatibility try to mimic compose v1 as much as possible ComposeCompatibility = api.ComposeCompatibility // ComposeRemoveOrphans remove "orphaned" containers, i.e. containers tagged for current project but not declared as service ComposeRemoveOrphans = "COMPOSE_REMOVE_ORPHANS" // ComposeIgnoreOrphans ignore "orphaned" containers ComposeIgnoreOrphans = "COMPOSE_IGNORE_ORPHANS" // ComposeEnvFiles defines the env files to use if --env-file isn't used ComposeEnvFiles = "COMPOSE_ENV_FILES" // ComposeMenu defines if the navigation menu should be rendered. Can be also set via --menu ComposeMenu = "COMPOSE_MENU" // ComposeProgress defines type of progress output, if --progress isn't used ComposeProgress = "COMPOSE_PROGRESS" )
const PluginName = "compose"
PluginName is the name of the plugin
Variables ¶
This section is empty.
Functions ¶
func AdaptCmd ¶
func AdaptCmd(fn CobraCommand) func(cmd *cobra.Command, args []string) error
AdaptCmd adapt a CobraCommand func to cobra library
func HooksCommand ¶ added in v5.1.3
HooksCommand returns the hidden subcommand that the Docker CLI invokes after command execution when the compose plugin has hooks configured. Docker Desktop is responsible for registering which commands trigger hooks and for gating on feature flags/settings — the hook handler simply responds with the appropriate hint message.
func RootCommand ¶
func RootCommand(dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command
RootCommand returns the compose command with its child commands
func RunningAsStandalone ¶
func RunningAsStandalone() bool
RunningAsStandalone detects when running as a standalone program
Types ¶
type BackendOptions ¶
func (*BackendOptions) Add ¶
func (o *BackendOptions) Add(option compose.Option)
type CobraCommand ¶
CobraCommand defines a cobra command function
type ProjectFunc ¶
ProjectFunc does stuff within a types.Project
type ProjectOptions ¶
type ProjectOptions struct {
ProjectName string
Profiles []string
ConfigPaths []string
WorkDir string
ProjectDir string
EnvFiles []string
Compatibility bool
Progress string
Offline bool
All bool
// contains filtered or unexported fields
}
func (*ProjectOptions) ToProject ¶
func (o *ProjectOptions) ToProject(ctx context.Context, dockerCli command.Cli, backend api.Compose, services []string, po ...cli.ProjectOptionsFn) (*types.Project, tracing.Metrics, error)
ToProject loads a Compose project using the LoadProject API. Accepts optional cli.ProjectOptionsFn to control loader behavior.
func (*ProjectOptions) WithProject ¶
func (o *ProjectOptions) WithProject(fn ProjectFunc, dockerCli command.Cli) func(cmd *cobra.Command, args []string) error
WithProject creates a cobra run command from a ProjectFunc based on configured project options and selected services
func (*ProjectOptions) WithServices ¶
func (o *ProjectOptions) WithServices(dockerCli command.Cli, fn ProjectServicesFunc) func(cmd *cobra.Command, args []string) error
WithServices creates a cobra run command from a ProjectFunc based on configured project options and selected services
Source Files
¶
- alpha.go
- attach.go
- bridge.go
- build.go
- commit.go
- completion.go
- compose.go
- config.go
- cp.go
- create.go
- down.go
- events.go
- exec.go
- export.go
- generate.go
- hooks.go
- images.go
- kill.go
- list.go
- logs.go
- options.go
- pause.go
- port.go
- ps.go
- publish.go
- pull.go
- push.go
- remove.go
- restart.go
- run.go
- scale.go
- start.go
- stats.go
- stop.go
- top.go
- up.go
- version.go
- viz.go
- volumes.go
- wait.go
- watch.go