Documentation
¶
Index ¶
- Constants
- Variables
- func GetImageNameOrDefault(service types.ServiceConfig, projectName string) string
- func IsAlreadyExistsError(err error) bool
- func IsErrCanceled(err error) bool
- func IsErrNotImplemented(err error) bool
- func IsErrParsingFailed(err error) bool
- func IsErrUnsupportedFlag(err error) bool
- func IsForbiddenError(err error) bool
- func IsNotFoundError(err error) bool
- func IsUnknownError(err error) bool
- type AttachOptions
- type BuildOptions
- type Cascade
- type CommitOptions
- type Compose
- type ConfigOptions
- type ContainerEvent
- type ContainerEventListener
- type ContainerProcSummary
- type ContainerSummary
- type CopyOptions
- type CreateOptions
- type DownOptions
- type DryRunClient
- func (d *DryRunClient) BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error)
- func (d *DryRunClient) BuildCancel(ctx context.Context, id string) error
- func (d *DryRunClient) CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error
- func (d *DryRunClient) CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error
- func (d *DryRunClient) CheckpointList(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error)
- func (d *DryRunClient) ClientVersion() string
- func (d *DryRunClient) Close() error
- func (d *DryRunClient) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error)
- func (d *DryRunClient) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error)
- func (d *DryRunClient) ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error)
- func (d *DryRunClient) ConfigRemove(ctx context.Context, id string) error
- func (d *DryRunClient) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error
- func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, options containerType.AttachOptions) (moby.HijackedResponse, error)
- func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options containerType.CommitOptions) (containerType.CommitResponse, error)
- func (d *DryRunClient) ContainerCreate(ctx context.Context, config *containerType.Config, ...) (containerType.CreateResponse, error)
- func (d *DryRunClient) ContainerDiff(ctx context.Context, container string) ([]containerType.FilesystemChange, error)
- func (d *DryRunClient) ContainerExecAttach(ctx context.Context, execID string, config containerType.ExecStartOptions) (moby.HijackedResponse, error)
- func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config containerType.ExecOptions) (containerType.ExecCreateResponse, error)
- func (d *DryRunClient) ContainerExecInspect(ctx context.Context, execID string) (containerType.ExecInspect, error)
- func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options containerType.ResizeOptions) error
- func (d *DryRunClient) ContainerExecStart(ctx context.Context, execID string, config containerType.ExecStartOptions) error
- func (d *DryRunClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
- func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (containerType.InspectResponse, error)
- func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (containerType.InspectResponse, []byte, error)
- func (d *DryRunClient) ContainerKill(ctx context.Context, container, signal string) error
- func (d *DryRunClient) ContainerList(ctx context.Context, options containerType.ListOptions) ([]containerType.Summary, error)
- func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, options containerType.LogsOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ContainerPause(ctx context.Context, container string) error
- func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options containerType.RemoveOptions) error
- func (d *DryRunClient) ContainerRename(ctx context.Context, container, newContainerName string) error
- func (d *DryRunClient) ContainerResize(ctx context.Context, container string, options containerType.ResizeOptions) error
- func (d *DryRunClient) ContainerRestart(ctx context.Context, container string, options containerType.StopOptions) error
- func (d *DryRunClient) ContainerStart(ctx context.Context, container string, options containerType.StartOptions) error
- func (d *DryRunClient) ContainerStatPath(ctx context.Context, container, path string) (containerType.PathStat, error)
- func (d *DryRunClient) ContainerStats(ctx context.Context, container string, stream bool) (containerType.StatsResponseReader, error)
- func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container string) (containerType.StatsResponseReader, error)
- func (d *DryRunClient) ContainerStop(ctx context.Context, container string, options containerType.StopOptions) error
- func (d *DryRunClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerType.TopResponse, error)
- func (d *DryRunClient) ContainerUnpause(ctx context.Context, container string) error
- func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.UpdateResponse, error)
- func (d *DryRunClient) ContainerWait(ctx context.Context, container string, condition containerType.WaitCondition) (<-chan containerType.WaitResponse, <-chan error)
- func (d *DryRunClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (containerType.PruneReport, error)
- func (d *DryRunClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, containerType.PathStat, error)
- func (d *DryRunClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, ...) error
- func (d *DryRunClient) DaemonHost() string
- func (d *DryRunClient) DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
- func (d *DryRunClient) Dialer() func(context.Context) (net.Conn, error)
- func (d *DryRunClient) DiskUsage(ctx context.Context, options moby.DiskUsageOptions) (moby.DiskUsage, error)
- func (d *DryRunClient) DistributionInspect(ctx context.Context, imageName, encodedRegistryAuth string) (registry.DistributionInspect, error)
- func (d *DryRunClient) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error)
- func (d *DryRunClient) HTTPClient() *http.Client
- func (d *DryRunClient) ImageBuild(ctx context.Context, reader io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error)
- func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string, options ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error)
- func (d *DryRunClient) ImageImport(ctx context.Context, source image.ImportSource, ref string, ...) (io.ReadCloser, error)
- func (d *DryRunClient) ImageInspect(ctx context.Context, imageName string, options ...client.ImageInspectOption) (image.InspectResponse, error)
- func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (image.InspectResponse, []byte, error)deprecated
- func (d *DryRunClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
- func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, options ...client.ImageLoadOption) (image.LoadResponse, error)
- func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options image.RemoveOptions) ([]image.DeleteResponse, error)
- func (d *DryRunClient) ImageSave(ctx context.Context, images []string, options ...client.ImageSaveOption) (io.ReadCloser, error)
- func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error)
- func (d *DryRunClient) ImageTag(ctx context.Context, imageName, ref string) error
- func (d *DryRunClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error)
- func (d *DryRunClient) Info(ctx context.Context) (system.Info, error)
- func (d *DryRunClient) NegotiateAPIVersion(ctx context.Context)
- func (d *DryRunClient) NegotiateAPIVersionPing(ping moby.Ping)
- func (d *DryRunClient) NetworkConnect(ctx context.Context, networkName, container string, ...) error
- func (d *DryRunClient) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
- func (d *DryRunClient) NetworkDisconnect(ctx context.Context, networkName, container string, force bool) error
- func (d *DryRunClient) NetworkInspect(ctx context.Context, networkName string, options network.InspectOptions) (network.Inspect, error)
- func (d *DryRunClient) NetworkInspectWithRaw(ctx context.Context, networkName string, options network.InspectOptions) (network.Inspect, []byte, error)
- func (d *DryRunClient) NetworkList(ctx context.Context, options network.ListOptions) ([]network.Inspect, error)
- func (d *DryRunClient) NetworkRemove(ctx context.Context, networkName string) error
- func (d *DryRunClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error)
- func (d *DryRunClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error)
- func (d *DryRunClient) NodeList(ctx context.Context, options swarm.NodeListOptions) ([]swarm.Node, error)
- func (d *DryRunClient) NodeRemove(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions) error
- func (d *DryRunClient) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error
- func (d *DryRunClient) Ping(ctx context.Context) (moby.Ping, error)
- func (d *DryRunClient) PluginCreate(ctx context.Context, createContext io.Reader, options moby.PluginCreateOptions) error
- func (d *DryRunClient) PluginDisable(ctx context.Context, name string, options moby.PluginDisableOptions) error
- func (d *DryRunClient) PluginEnable(ctx context.Context, name string, options moby.PluginEnableOptions) error
- func (d *DryRunClient) PluginInspectWithRaw(ctx context.Context, name string) (*moby.Plugin, []byte, error)
- func (d *DryRunClient) PluginInstall(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
- func (d *DryRunClient) PluginList(ctx context.Context, filter filters.Args) (moby.PluginsListResponse, error)
- func (d *DryRunClient) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)
- func (d *DryRunClient) PluginRemove(ctx context.Context, name string, options moby.PluginRemoveOptions) error
- func (d *DryRunClient) PluginSet(ctx context.Context, name string, args []string) error
- func (d *DryRunClient) PluginUpgrade(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
- func (d *DryRunClient) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
- func (d *DryRunClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error)
- func (d *DryRunClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error)
- func (d *DryRunClient) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error)
- func (d *DryRunClient) SecretRemove(ctx context.Context, id string) error
- func (d *DryRunClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error
- func (d *DryRunClient) ServerVersion(ctx context.Context) (moby.Version, error)
- func (d *DryRunClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, ...) (swarm.ServiceCreateResponse, error)
- func (d *DryRunClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error)
- func (d *DryRunClient) ServiceList(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error)
- func (d *DryRunClient) ServiceLogs(ctx context.Context, serviceID string, options containerType.LogsOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ServiceRemove(ctx context.Context, serviceID string) error
- func (d *DryRunClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, ...) (swarm.ServiceUpdateResponse, error)
- func (d *DryRunClient) SwarmGetUnlockKey(ctx context.Context) (swarm.UnlockKeyResponse, error)
- func (d *DryRunClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
- func (d *DryRunClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error)
- func (d *DryRunClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
- func (d *DryRunClient) SwarmLeave(ctx context.Context, force bool) error
- func (d *DryRunClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
- func (d *DryRunClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarmSpec swarm.Spec, ...) error
- func (d *DryRunClient) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error)
- func (d *DryRunClient) TaskList(ctx context.Context, options swarm.TaskListOptions) ([]swarm.Task, error)
- func (d *DryRunClient) TaskLogs(ctx context.Context, taskID string, options containerType.LogsOptions) (io.ReadCloser, error)
- func (d *DryRunClient) VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
- func (d *DryRunClient) VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)
- func (d *DryRunClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (volume.Volume, []byte, error)
- func (d *DryRunClient) VolumeList(ctx context.Context, opts volume.ListOptions) (volume.ListResponse, error)
- func (d *DryRunClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error
- func (d *DryRunClient) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, ...) error
- func (d *DryRunClient) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (volume.PruneReport, error)
- type DryRunKey
- type Event
- type EventsOptions
- type ExportOptions
- type GenerateOptions
- type ImageSummary
- type ImagesOptions
- type KillOptions
- type ListOptions
- type LogConsumer
- type LogOptions
- type OCIVersion
- type PauseOptions
- type PortOptions
- type PortPublisher
- type PortPublishers
- type PsOptions
- type PublishOptions
- type PullOptions
- type PushOptions
- type RemoveOptions
- type RestartOptions
- type RunOptions
- type ScaleOptions
- type ServiceStatus
- type Stack
- type StartOptions
- type StopOptions
- type Streams
- type UpOptions
- type VizOptions
- type VolumesOptions
- type VolumesSummary
- type WaitOptions
- type WatchOptions
Constants ¶
const ( // STARTING indicates that stack is being deployed STARTING string = "Starting" // RUNNING indicates that stack is deployed and services are running RUNNING string = "Running" // UPDATING indicates that some stack resources are being recreated UPDATING string = "Updating" // REMOVING indicates that stack is being deleted REMOVING string = "Removing" // UNKNOWN indicates unknown stack state UNKNOWN string = "Unknown" // FAILED indicates that stack deployment failed FAILED string = "Failed" )
const ( // RecreateDiverged to recreate services which configuration diverges from compose model RecreateDiverged = "diverged" // RecreateForce to force service container being recreated RecreateForce = "force" // RecreateNever to never recreate existing service containers RecreateNever = "never" )
const ( // ContainerEventLog is a ContainerEvent of type log on stdout. Line is set ContainerEventLog = iota // ContainerEventErr is a ContainerEvent of type log on stderr. Line is set ContainerEventErr // ContainerEventStarted let consumer know a container has been started ContainerEventStarted // ContainerEventRestarted let consumer know a container has been restarted ContainerEventRestarted // ContainerEventStopped is a ContainerEvent of type stopped. ContainerEventStopped // ContainerEventCreated let consumer know a new container has been created ContainerEventCreated // ContainerEventRecreated let consumer know container stopped but his being replaced ContainerEventRecreated // ContainerEventExited is a ContainerEvent of type exit. ExitCode is set ContainerEventExited // UserCancel user cancelled compose up, we are stopping containers HookEventLog )
const ( // ProjectLabel allow to track resource related to a compose project ProjectLabel = "com.docker.compose.project" // ServiceLabel allow to track resource related to a compose service ServiceLabel = "com.docker.compose.service" // ConfigHashLabel stores configuration hash for a compose service ConfigHashLabel = "com.docker.compose.config-hash" // ContainerNumberLabel stores the container index of a replicated service ContainerNumberLabel = "com.docker.compose.container-number" // VolumeLabel allow to track resource related to a compose volume VolumeLabel = "com.docker.compose.volume" // NetworkLabel allow to track resource related to a compose network NetworkLabel = "com.docker.compose.network" // WorkingDirLabel stores absolute path to compose project working directory WorkingDirLabel = "com.docker.compose.project.working_dir" // ConfigFilesLabel stores absolute path to compose project configuration files ConfigFilesLabel = "com.docker.compose.project.config_files" // EnvironmentFileLabel stores absolute path to compose project env file set by `--env-file` EnvironmentFileLabel = "com.docker.compose.project.environment_file" // OneoffLabel stores value 'True' for one-off containers created by `compose run` OneoffLabel = "com.docker.compose.oneoff" // SlugLabel stores unique slug used for one-off container identity SlugLabel = "com.docker.compose.slug" // ImageDigestLabel stores digest of the container image used to run service ImageDigestLabel = "com.docker.compose.image" // DependenciesLabel stores service dependencies DependenciesLabel = "com.docker.compose.depends_on" // VersionLabel stores the compose tool version used to build/run application VersionLabel = "com.docker.compose.version" // ImageBuilderLabel stores the builder (classic or BuildKit) used to produce the image. ImageBuilderLabel = "com.docker.compose.image.builder" // ContainerReplaceLabel is set when container is created to replace another container (recreated) ContainerReplaceLabel = "com.docker.compose.replace" )
const (
DRYRUN_PREFIX = " DRY-RUN MODE - "
)
const ( // ExitCodeLoginRequired exit code when command cannot execute because it requires cloud login // This will be used by VSCode to detect when creating context if the user needs to login first ExitCodeLoginRequired = 5 )
const WatchLogger = "#watch"
WatchLogger is a reserved name to log watch events
Variables ¶
var ( // ErrNotFound is returned when an object is not found ErrNotFound = errors.New("not found") // ErrAlreadyExists is returned when an object already exists ErrAlreadyExists = errors.New("already exists") // ErrForbidden is returned when an operation is not permitted ErrForbidden = errors.New("forbidden") // ErrUnknown is returned when the error type is unmapped ErrUnknown = errors.New("unknown") // ErrLoginFailed is returned when login failed ErrLoginFailed = errors.New("login failed") // ErrLoginRequired is returned when login is required for a specific action ErrLoginRequired = errors.New("login required") // ErrNotImplemented is returned when a backend doesn't implement // an action ErrNotImplemented = errors.New("not implemented") // ErrUnsupportedFlag is returned when a backend doesn't support a flag ErrUnsupportedFlag = errors.New("unsupported flag") // ErrCanceled is returned when the command was canceled by user ErrCanceled = errors.New("canceled") // ErrParsingFailed is returned when a string cannot be parsed ErrParsingFailed = errors.New("parsing failed") // ErrWrongContextType is returned when the caller tries to get a context // with the wrong type ErrWrongContextType = errors.New("wrong context type") )
var ComposeVersion string
ComposeVersion is the compose tool version as declared by label VersionLabel
var Separator = "-"
Separator is used for naming components
Functions ¶
func GetImageNameOrDefault ¶ added in v2.8.0
func GetImageNameOrDefault(service types.ServiceConfig, projectName string) string
GetImageNameOrDefault computes the default image name for a service, used to tag built images
func IsAlreadyExistsError ¶
IsAlreadyExistsError returns true if the unwrapped error is ErrAlreadyExists
func IsErrCanceled ¶
IsErrCanceled returns true if the unwrapped error is ErrCanceled
func IsErrNotImplemented ¶
IsErrNotImplemented returns true if the unwrapped error is ErrNotImplemented
func IsErrParsingFailed ¶
IsErrParsingFailed returns true if the unwrapped error is ErrParsingFailed
func IsErrUnsupportedFlag ¶
IsErrUnsupportedFlag returns true if the unwrapped error is ErrUnsupportedFlag
func IsForbiddenError ¶
IsForbiddenError returns true if the unwrapped error is ErrForbidden
func IsNotFoundError ¶
IsNotFoundError returns true if the unwrapped error is ErrNotFound
func IsUnknownError ¶
IsUnknownError returns true if the unwrapped error is ErrUnknown
Types ¶
type AttachOptions ¶ added in v2.24.0
type AttachOptions struct {
Project *types.Project
Service string
Index int
DetachKeys string
NoStdin bool
Proxy bool
}
AttachOptions group options of the Attach API
type BuildOptions ¶
type BuildOptions struct {
// Pull always attempt to pull a newer version of the image
Pull bool
// Push pushes service images
Push bool
// Progress set type of progress output ("auto", "plain", "tty")
Progress string
// Args set build-time args
Args types.MappingWithEquals
// NoCache disables cache use
NoCache bool
// Quiet make the build process not output to the console
Quiet bool
// Services passed in the command line to be built
Services []string
// Deps also build selected services dependencies
Deps bool
// Ssh authentications passed in the command line
SSHs []types.SSHKey
// Memory limit for the build container
Memory int64
// Builder name passed in the command line
Builder string
// Print don't actually run builder but print equivalent build config
Print bool
// Check let builder validate build configuration
Check bool
// Attestations allows to enable attestations generation
Attestations bool
// Provenance generate a provenance attestation
Provenance string
// SBOM generate a SBOM attestation
SBOM string
// Out is the stream to write build progress
Out io.Writer
}
BuildOptions group options of the Build API
type CommitOptions ¶ added in v2.31.0
type CommitOptions struct {
Service string
Reference string
Pause bool
Comment string
Author string
Changes opts.ListOpts
Index int
}
CommitOptions group options of the Commit API
type Compose ¶ added in v2.40.2
type Compose interface {
// Build executes the equivalent to a `compose build`
Build(ctx context.Context, project *types.Project, options BuildOptions) error
// Push executes the equivalent to a `compose push`
Push(ctx context.Context, project *types.Project, options PushOptions) error
// Pull executes the equivalent of a `compose pull`
Pull(ctx context.Context, project *types.Project, options PullOptions) error
// Create executes the equivalent to a `compose create`
Create(ctx context.Context, project *types.Project, options CreateOptions) error
// Start executes the equivalent to a `compose start`
Start(ctx context.Context, projectName string, options StartOptions) error
// Restart restarts containers
Restart(ctx context.Context, projectName string, options RestartOptions) error
// Stop executes the equivalent to a `compose stop`
Stop(ctx context.Context, projectName string, options StopOptions) error
// Up executes the equivalent to a `compose up`
Up(ctx context.Context, project *types.Project, options UpOptions) error
// Down executes the equivalent to a `compose down`
Down(ctx context.Context, projectName string, options DownOptions) error
// Logs executes the equivalent to a `compose logs`
Logs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error
// Ps executes the equivalent to a `compose ps`
Ps(ctx context.Context, projectName string, options PsOptions) ([]ContainerSummary, error)
// List executes the equivalent to a `docker stack ls`
List(ctx context.Context, options ListOptions) ([]Stack, error)
// Kill executes the equivalent to a `compose kill`
Kill(ctx context.Context, projectName string, options KillOptions) error
// RunOneOffContainer creates a service oneoff container and starts its dependencies
RunOneOffContainer(ctx context.Context, project *types.Project, opts RunOptions) (int, error)
// Remove executes the equivalent to a `compose rm`
Remove(ctx context.Context, projectName string, options RemoveOptions) error
// Exec executes a command in a running service container
Exec(ctx context.Context, projectName string, options RunOptions) (int, error)
// Attach STDIN,STDOUT,STDERR to a running service container
Attach(ctx context.Context, projectName string, options AttachOptions) error
// Copy copies a file/folder between a service container and the local filesystem
Copy(ctx context.Context, projectName string, options CopyOptions) error
// Pause executes the equivalent to a `compose pause`
Pause(ctx context.Context, projectName string, options PauseOptions) error
// UnPause executes the equivalent to a `compose unpause`
UnPause(ctx context.Context, projectName string, options PauseOptions) error
// Top executes the equivalent to a `compose top`
Top(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error)
// Events executes the equivalent to a `compose events`
Events(ctx context.Context, projectName string, options EventsOptions) error
// Port executes the equivalent to a `compose port`
Port(ctx context.Context, projectName string, service string, port uint16, options PortOptions) (string, int, error)
// Publish executes the equivalent to a `compose publish`
Publish(ctx context.Context, project *types.Project, repository string, options PublishOptions) error
// Images executes the equivalent of a `compose images`
Images(ctx context.Context, projectName string, options ImagesOptions) (map[string]ImageSummary, error)
// MaxConcurrency defines upper limit for concurrent operations against engine API
MaxConcurrency(parallel int)
// DryRunMode defines if dry run applies to the command
DryRunMode(ctx context.Context, dryRun bool) (context.Context, error)
// Watch services' development context and sync/notify/rebuild/restart on changes
Watch(ctx context.Context, project *types.Project, options WatchOptions) error
// Viz generates a graphviz graph of the project services
Viz(ctx context.Context, project *types.Project, options VizOptions) (string, error)
// Wait blocks until at least one of the services' container exits
Wait(ctx context.Context, projectName string, options WaitOptions) (int64, error)
// Scale manages numbers of container instances running per service
Scale(ctx context.Context, project *types.Project, options ScaleOptions) error
// Export a service container's filesystem as a tar archive
Export(ctx context.Context, projectName string, options ExportOptions) error
// Create a new image from a service container's changes
Commit(ctx context.Context, projectName string, options CommitOptions) error
// Generate generates a Compose Project from existing containers
Generate(ctx context.Context, options GenerateOptions) (*types.Project, error)
// Volumes executes the equivalent to a `docker volume ls`
Volumes(ctx context.Context, project string, options VolumesOptions) ([]VolumesSummary, error)
}
Compose is the API interface one can use to programmatically use docker/compose in a third-party software Use [compose.NewComposeService] to get an actual instance
type ConfigOptions ¶ added in v2.16.0
type ConfigOptions struct {
// Format define the output format used to dump converted application model (json|yaml)
Format string
// Output defines the path to save the application model
Output string
// Resolve image reference to digests
ResolveImageDigests bool
}
ConfigOptions group options of the Config API
type ContainerEvent ¶
type ContainerEvent struct {
Type int
Time int64
Container *ContainerSummary
// Source is the name of the container _without the project prefix_.
//
// This is only suitable for display purposes within Compose, as it's
// not guaranteed to be unique across services.
Source string
ID string
Service string
Line string
// ExitCode is only set on ContainerEventExited events
ExitCode int
Restarting bool
}
ContainerEvent notify an event has been collected on source container implementing Service
type ContainerEventListener ¶
type ContainerEventListener func(event ContainerEvent)
ContainerEventListener is a callback to process ContainerEvent from services
type ContainerProcSummary ¶
type ContainerProcSummary struct {
ID string
Name string
Processes [][]string
Titles []string
Service string
Replica string
}
ContainerProcSummary holds container processes top data
type ContainerSummary ¶
type ContainerSummary struct {
ID string
Name string
Names []string
Image string
Command string
Project string
Service string
Created int64
State string
Status string
Health string
ExitCode int
Publishers PortPublishers
Labels map[string]string
SizeRw int64 `json:",omitempty"`
SizeRootFs int64 `json:",omitempty"`
Mounts []string
Networks []string
LocalVolumes int
}
ContainerSummary hold high-level description of a container
type CopyOptions ¶
type CopyOptions struct {
Source string
Destination string
All bool
Index int
FollowLink bool
CopyUIDGID bool
}
CopyOptions group options of the cp API
type CreateOptions ¶
type CreateOptions struct {
Build *BuildOptions
// Services defines the services user interacts with
Services []string
// Remove legacy containers for services that are not defined in the project
RemoveOrphans bool
// Ignore legacy containers for services that are not defined in the project
IgnoreOrphans bool
// Recreate define the strategy to apply on existing containers
Recreate string
// RecreateDependencies define the strategy to apply on dependencies services
RecreateDependencies string
// Inherit reuse anonymous volumes from previous container
Inherit bool
// Timeout set delay to wait for container to gracefully stop before sending SIGKILL
Timeout *time.Duration
// QuietPull makes the pulling process quiet
QuietPull bool
// AssumeYes assume "yes" as answer to all prompts and run non-interactively
AssumeYes bool
}
CreateOptions group options of the Create API
type DownOptions ¶
type DownOptions struct {
// RemoveOrphans will cleanup containers that are not declared on the compose model but own the same labels
RemoveOrphans bool
// Project is the compose project used to define this app. Might be nil if user ran `down` just with project name
Project *types.Project
// Timeout override container stop timeout
Timeout *time.Duration
// Images remove image used by services. 'all': Remove all images. 'local': Remove only images that don't have a tag
Images string
// Volumes remove volumes, both declared in the `volumes` section and anonymous ones
Volumes bool
// Services passed in the command line to be stopped
Services []string
}
DownOptions group options of the Down API
type DryRunClient ¶ added in v2.16.0
type DryRunClient struct {
// contains filtered or unexported fields
}
DryRunClient implements APIClient by delegating to implementation functions. This allows lazy init and per-method overrides
func NewDryRunClient ¶ added in v2.16.0
NewDryRunClient produces a DryRunClient
func (*DryRunClient) BuildCachePrune ¶ added in v2.16.0
func (d *DryRunClient) BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error)
func (*DryRunClient) BuildCancel ¶ added in v2.16.0
func (d *DryRunClient) BuildCancel(ctx context.Context, id string) error
func (*DryRunClient) CheckpointCreate ¶ added in v2.16.0
func (d *DryRunClient) CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error
func (*DryRunClient) CheckpointDelete ¶ added in v2.16.0
func (d *DryRunClient) CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error
func (*DryRunClient) CheckpointList ¶ added in v2.16.0
func (d *DryRunClient) CheckpointList(ctx context.Context, container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error)
func (*DryRunClient) ClientVersion ¶ added in v2.16.0
func (d *DryRunClient) ClientVersion() string
func (*DryRunClient) Close ¶ added in v2.16.0
func (d *DryRunClient) Close() error
func (*DryRunClient) ConfigCreate ¶ added in v2.16.0
func (d *DryRunClient) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error)
func (*DryRunClient) ConfigInspectWithRaw ¶ added in v2.16.0
func (*DryRunClient) ConfigList ¶ added in v2.16.0
func (d *DryRunClient) ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error)
func (*DryRunClient) ConfigRemove ¶ added in v2.16.0
func (d *DryRunClient) ConfigRemove(ctx context.Context, id string) error
func (*DryRunClient) ConfigUpdate ¶ added in v2.16.0
func (d *DryRunClient) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error
func (*DryRunClient) ContainerAttach ¶ added in v2.16.0
func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, options containerType.AttachOptions) (moby.HijackedResponse, error)
func (*DryRunClient) ContainerCommit ¶ added in v2.16.0
func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options containerType.CommitOptions) (containerType.CommitResponse, error)
func (*DryRunClient) ContainerCreate ¶ added in v2.16.0
func (d *DryRunClient) ContainerCreate(ctx context.Context, config *containerType.Config, hostConfig *containerType.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string, ) (containerType.CreateResponse, error)
func (*DryRunClient) ContainerDiff ¶ added in v2.16.0
func (d *DryRunClient) ContainerDiff(ctx context.Context, container string) ([]containerType.FilesystemChange, error)
func (*DryRunClient) ContainerExecAttach ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecAttach(ctx context.Context, execID string, config containerType.ExecStartOptions) (moby.HijackedResponse, error)
func (*DryRunClient) ContainerExecCreate ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config containerType.ExecOptions) (containerType.ExecCreateResponse, error)
func (*DryRunClient) ContainerExecInspect ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecInspect(ctx context.Context, execID string) (containerType.ExecInspect, error)
func (*DryRunClient) ContainerExecResize ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options containerType.ResizeOptions) error
func (*DryRunClient) ContainerExecStart ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecStart(ctx context.Context, execID string, config containerType.ExecStartOptions) error
func (*DryRunClient) ContainerExport ¶ added in v2.16.0
func (d *DryRunClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
func (*DryRunClient) ContainerInspect ¶ added in v2.16.0
func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (containerType.InspectResponse, error)
func (*DryRunClient) ContainerInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (containerType.InspectResponse, []byte, error)
func (*DryRunClient) ContainerKill ¶ added in v2.16.0
func (d *DryRunClient) ContainerKill(ctx context.Context, container, signal string) error
func (*DryRunClient) ContainerList ¶ added in v2.16.0
func (d *DryRunClient) ContainerList(ctx context.Context, options containerType.ListOptions) ([]containerType.Summary, error)
func (*DryRunClient) ContainerLogs ¶ added in v2.16.0
func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, options containerType.LogsOptions) (io.ReadCloser, error)
func (*DryRunClient) ContainerPause ¶ added in v2.16.0
func (d *DryRunClient) ContainerPause(ctx context.Context, container string) error
func (*DryRunClient) ContainerRemove ¶ added in v2.16.0
func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options containerType.RemoveOptions) error
func (*DryRunClient) ContainerRename ¶ added in v2.16.0
func (d *DryRunClient) ContainerRename(ctx context.Context, container, newContainerName string) error
func (*DryRunClient) ContainerResize ¶ added in v2.16.0
func (d *DryRunClient) ContainerResize(ctx context.Context, container string, options containerType.ResizeOptions) error
func (*DryRunClient) ContainerRestart ¶ added in v2.16.0
func (d *DryRunClient) ContainerRestart(ctx context.Context, container string, options containerType.StopOptions) error
func (*DryRunClient) ContainerStart ¶ added in v2.16.0
func (d *DryRunClient) ContainerStart(ctx context.Context, container string, options containerType.StartOptions) error
func (*DryRunClient) ContainerStatPath ¶ added in v2.16.0
func (d *DryRunClient) ContainerStatPath(ctx context.Context, container, path string) (containerType.PathStat, error)
func (*DryRunClient) ContainerStats ¶ added in v2.16.0
func (d *DryRunClient) ContainerStats(ctx context.Context, container string, stream bool) (containerType.StatsResponseReader, error)
func (*DryRunClient) ContainerStatsOneShot ¶ added in v2.16.0
func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container string) (containerType.StatsResponseReader, error)
func (*DryRunClient) ContainerStop ¶ added in v2.16.0
func (d *DryRunClient) ContainerStop(ctx context.Context, container string, options containerType.StopOptions) error
func (*DryRunClient) ContainerTop ¶ added in v2.16.0
func (d *DryRunClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerType.TopResponse, error)
func (*DryRunClient) ContainerUnpause ¶ added in v2.16.0
func (d *DryRunClient) ContainerUnpause(ctx context.Context, container string) error
func (*DryRunClient) ContainerUpdate ¶ added in v2.16.0
func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.UpdateResponse, error)
func (*DryRunClient) ContainerWait ¶ added in v2.16.0
func (d *DryRunClient) ContainerWait(ctx context.Context, container string, condition containerType.WaitCondition) (<-chan containerType.WaitResponse, <-chan error)
func (*DryRunClient) ContainersPrune ¶ added in v2.16.0
func (d *DryRunClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (containerType.PruneReport, error)
func (*DryRunClient) CopyFromContainer ¶ added in v2.16.0
func (d *DryRunClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, containerType.PathStat, error)
func (*DryRunClient) CopyToContainer ¶ added in v2.16.0
func (d *DryRunClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options containerType.CopyToContainerOptions) error
func (*DryRunClient) DaemonHost ¶ added in v2.16.0
func (d *DryRunClient) DaemonHost() string
func (*DryRunClient) DialHijack ¶ added in v2.16.0
func (*DryRunClient) DiskUsage ¶ added in v2.16.0
func (d *DryRunClient) DiskUsage(ctx context.Context, options moby.DiskUsageOptions) (moby.DiskUsage, error)
func (*DryRunClient) DistributionInspect ¶ added in v2.16.0
func (d *DryRunClient) DistributionInspect(ctx context.Context, imageName, encodedRegistryAuth string) (registry.DistributionInspect, error)
func (*DryRunClient) Events ¶ added in v2.16.0
func (d *DryRunClient) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error)
func (*DryRunClient) HTTPClient ¶ added in v2.16.0
func (d *DryRunClient) HTTPClient() *http.Client
func (*DryRunClient) ImageBuild ¶ added in v2.16.0
func (d *DryRunClient) ImageBuild(ctx context.Context, reader io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error)
func (*DryRunClient) ImageCreate ¶ added in v2.16.0
func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageHistory ¶ added in v2.16.0
func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string, options ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error)
func (*DryRunClient) ImageImport ¶ added in v2.16.0
func (d *DryRunClient) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageInspect ¶ added in v2.33.1
func (d *DryRunClient) ImageInspect(ctx context.Context, imageName string, options ...client.ImageInspectOption) (image.InspectResponse, error)
func (*DryRunClient) ImageInspectWithRaw
deprecated
added in
v2.16.0
func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (image.InspectResponse, []byte, error)
Deprecated: Use DryRunClient.ImageInspect instead; raw response can be obtained by client.ImageInspectWithRawResponse option.
func (*DryRunClient) ImageList ¶ added in v2.16.0
func (d *DryRunClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
func (*DryRunClient) ImageLoad ¶ added in v2.16.0
func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, options ...client.ImageLoadOption) (image.LoadResponse, error)
func (*DryRunClient) ImagePull ¶ added in v2.16.0
func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)
func (*DryRunClient) ImagePush ¶ added in v2.16.0
func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageRemove ¶ added in v2.16.0
func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options image.RemoveOptions) ([]image.DeleteResponse, error)
func (*DryRunClient) ImageSave ¶ added in v2.16.0
func (d *DryRunClient) ImageSave(ctx context.Context, images []string, options ...client.ImageSaveOption) (io.ReadCloser, error)
func (*DryRunClient) ImageSearch ¶ added in v2.16.0
func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error)
func (*DryRunClient) ImageTag ¶ added in v2.16.0
func (d *DryRunClient) ImageTag(ctx context.Context, imageName, ref string) error
func (*DryRunClient) ImagesPrune ¶ added in v2.16.0
func (d *DryRunClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error)
func (*DryRunClient) NegotiateAPIVersion ¶ added in v2.16.0
func (d *DryRunClient) NegotiateAPIVersion(ctx context.Context)
func (*DryRunClient) NegotiateAPIVersionPing ¶ added in v2.16.0
func (d *DryRunClient) NegotiateAPIVersionPing(ping moby.Ping)
func (*DryRunClient) NetworkConnect ¶ added in v2.16.0
func (d *DryRunClient) NetworkConnect(ctx context.Context, networkName, container string, config *network.EndpointSettings) error
func (*DryRunClient) NetworkCreate ¶ added in v2.16.0
func (d *DryRunClient) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
func (*DryRunClient) NetworkDisconnect ¶ added in v2.16.0
func (*DryRunClient) NetworkInspect ¶ added in v2.16.0
func (d *DryRunClient) NetworkInspect(ctx context.Context, networkName string, options network.InspectOptions) (network.Inspect, error)
func (*DryRunClient) NetworkInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) NetworkInspectWithRaw(ctx context.Context, networkName string, options network.InspectOptions) (network.Inspect, []byte, error)
func (*DryRunClient) NetworkList ¶ added in v2.16.0
func (d *DryRunClient) NetworkList(ctx context.Context, options network.ListOptions) ([]network.Inspect, error)
func (*DryRunClient) NetworkRemove ¶ added in v2.16.0
func (d *DryRunClient) NetworkRemove(ctx context.Context, networkName string) error
func (*DryRunClient) NetworksPrune ¶ added in v2.16.0
func (d *DryRunClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error)
func (*DryRunClient) NodeInspectWithRaw ¶ added in v2.16.0
func (*DryRunClient) NodeList ¶ added in v2.16.0
func (d *DryRunClient) NodeList(ctx context.Context, options swarm.NodeListOptions) ([]swarm.Node, error)
func (*DryRunClient) NodeRemove ¶ added in v2.16.0
func (d *DryRunClient) NodeRemove(ctx context.Context, nodeID string, options swarm.NodeRemoveOptions) error
func (*DryRunClient) NodeUpdate ¶ added in v2.16.0
func (*DryRunClient) PluginCreate ¶ added in v2.16.0
func (d *DryRunClient) PluginCreate(ctx context.Context, createContext io.Reader, options moby.PluginCreateOptions) error
func (*DryRunClient) PluginDisable ¶ added in v2.16.0
func (d *DryRunClient) PluginDisable(ctx context.Context, name string, options moby.PluginDisableOptions) error
func (*DryRunClient) PluginEnable ¶ added in v2.16.0
func (d *DryRunClient) PluginEnable(ctx context.Context, name string, options moby.PluginEnableOptions) error
func (*DryRunClient) PluginInspectWithRaw ¶ added in v2.16.0
func (*DryRunClient) PluginInstall ¶ added in v2.16.0
func (d *DryRunClient) PluginInstall(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
func (*DryRunClient) PluginList ¶ added in v2.16.0
func (d *DryRunClient) PluginList(ctx context.Context, filter filters.Args) (moby.PluginsListResponse, error)
func (*DryRunClient) PluginPush ¶ added in v2.16.0
func (d *DryRunClient) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)
func (*DryRunClient) PluginRemove ¶ added in v2.16.0
func (d *DryRunClient) PluginRemove(ctx context.Context, name string, options moby.PluginRemoveOptions) error
func (*DryRunClient) PluginUpgrade ¶ added in v2.16.0
func (d *DryRunClient) PluginUpgrade(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
func (*DryRunClient) RegistryLogin ¶ added in v2.16.0
func (d *DryRunClient) RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
func (*DryRunClient) SecretCreate ¶ added in v2.16.0
func (d *DryRunClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error)
func (*DryRunClient) SecretInspectWithRaw ¶ added in v2.16.0
func (*DryRunClient) SecretList ¶ added in v2.16.0
func (d *DryRunClient) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error)
func (*DryRunClient) SecretRemove ¶ added in v2.16.0
func (d *DryRunClient) SecretRemove(ctx context.Context, id string) error
func (*DryRunClient) SecretUpdate ¶ added in v2.16.0
func (d *DryRunClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error
func (*DryRunClient) ServerVersion ¶ added in v2.16.0
func (*DryRunClient) ServiceCreate ¶ added in v2.16.0
func (d *DryRunClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options swarm.ServiceCreateOptions) (swarm.ServiceCreateResponse, error)
func (*DryRunClient) ServiceInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options swarm.ServiceInspectOptions) (swarm.Service, []byte, error)
func (*DryRunClient) ServiceList ¶ added in v2.16.0
func (d *DryRunClient) ServiceList(ctx context.Context, options swarm.ServiceListOptions) ([]swarm.Service, error)
func (*DryRunClient) ServiceLogs ¶ added in v2.16.0
func (d *DryRunClient) ServiceLogs(ctx context.Context, serviceID string, options containerType.LogsOptions) (io.ReadCloser, error)
func (*DryRunClient) ServiceRemove ¶ added in v2.16.0
func (d *DryRunClient) ServiceRemove(ctx context.Context, serviceID string) error
func (*DryRunClient) ServiceUpdate ¶ added in v2.16.0
func (d *DryRunClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options swarm.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
func (*DryRunClient) SwarmGetUnlockKey ¶ added in v2.16.0
func (d *DryRunClient) SwarmGetUnlockKey(ctx context.Context) (swarm.UnlockKeyResponse, error)
func (*DryRunClient) SwarmInit ¶ added in v2.16.0
func (d *DryRunClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
func (*DryRunClient) SwarmInspect ¶ added in v2.16.0
func (*DryRunClient) SwarmJoin ¶ added in v2.16.0
func (d *DryRunClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
func (*DryRunClient) SwarmLeave ¶ added in v2.16.0
func (d *DryRunClient) SwarmLeave(ctx context.Context, force bool) error
func (*DryRunClient) SwarmUnlock ¶ added in v2.16.0
func (d *DryRunClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
func (*DryRunClient) SwarmUpdate ¶ added in v2.16.0
func (d *DryRunClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarmSpec swarm.Spec, flags swarm.UpdateFlags) error
func (*DryRunClient) TaskInspectWithRaw ¶ added in v2.16.0
func (*DryRunClient) TaskList ¶ added in v2.16.0
func (d *DryRunClient) TaskList(ctx context.Context, options swarm.TaskListOptions) ([]swarm.Task, error)
func (*DryRunClient) TaskLogs ¶ added in v2.16.0
func (d *DryRunClient) TaskLogs(ctx context.Context, taskID string, options containerType.LogsOptions) (io.ReadCloser, error)
func (*DryRunClient) VolumeCreate ¶ added in v2.16.0
func (d *DryRunClient) VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
func (*DryRunClient) VolumeInspect ¶ added in v2.16.0
func (*DryRunClient) VolumeInspectWithRaw ¶ added in v2.16.0
func (*DryRunClient) VolumeList ¶ added in v2.16.0
func (d *DryRunClient) VolumeList(ctx context.Context, opts volume.ListOptions) (volume.ListResponse, error)
func (*DryRunClient) VolumeRemove ¶ added in v2.16.0
func (*DryRunClient) VolumeUpdate ¶ added in v2.16.0
func (d *DryRunClient) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error
func (*DryRunClient) VolumesPrune ¶ added in v2.16.0
func (d *DryRunClient) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (volume.PruneReport, error)
type Event ¶
type Event struct {
Timestamp time.Time
Service string
Container string
Status string
Attributes map[string]string
}
Event is a container runtime event served by Events API
type EventsOptions ¶
type EventsOptions struct {
Services []string
Consumer func(event Event) error
Since string
Until string
}
EventsOptions group options of the Events API
type ExportOptions ¶ added in v2.30.0
ExportOptions group options of the Export API
type GenerateOptions ¶ added in v2.30.0
type ImageSummary ¶
type ImageSummary struct {
ID string
Repository string
Tag string
Platform platforms.Platform
Size int64
Created time.Time
LastTagTime time.Time
}
ImageSummary holds container image description
type ImagesOptions ¶
type ImagesOptions struct {
Services []string
}
ImagesOptions group options of the Images API
type KillOptions ¶
type KillOptions struct {
// RemoveOrphans will cleanup containers that are not declared on the compose model but own the same labels
RemoveOrphans bool
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
// Services passed in the command line to be killed
Services []string
// Signal to send to containers
Signal string
// All can be set to true to try to kill all found containers, independently of their state
All bool
}
KillOptions group options of the Kill API
type LogConsumer ¶
type LogConsumer interface {
Log(containerName, message string)
Err(containerName, message string)
Status(container, msg string)
}
LogConsumer is a callback to process log messages from services
type LogOptions ¶
type LogOptions struct {
Project *types.Project
Index int
Services []string
Tail string
Since string
Until string
Follow bool
Timestamps bool
}
LogOptions defines optional parameters for the `Log` API
type OCIVersion ¶ added in v2.24.0
type OCIVersion string
OCIVersion controls manifest generation to ensure compatibility with different registries.
Currently, this is not exposed as an option to the user – Compose uses OCI 1.0 mode automatically for ECR registries based on domain and OCI 1.1 for all other registries.
There are likely other popular registries that do not support the OCI 1.1 format, so it might make sense to expose this as a CLI flag or see if there's a way to generically probe the registry for support level.
const ( OCIVersion1_0 OCIVersion = "1.0" OCIVersion1_1 OCIVersion = "1.1" )
type PauseOptions ¶
type PauseOptions struct {
// Services passed in the command line to be started
Services []string
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
}
PauseOptions group options of the Pause API
type PortOptions ¶
PortOptions group options of the Port API
type PortPublisher ¶
PortPublisher hold status about published port
type PortPublishers ¶
type PortPublishers []PortPublisher
PortPublishers is a slice of PortPublisher
func (PortPublishers) Less ¶
func (p PortPublishers) Less(i, j int) bool
Less implements sort.Interface
type PublishOptions ¶ added in v2.22.0
type PublishOptions struct {
ResolveImageDigests bool
Application bool
WithEnvironment bool
AssumeYes bool
OCIVersion OCIVersion
}
PublishOptions group options of the Publish API
type PullOptions ¶
PullOptions group options of the Pull API
type PushOptions ¶
PushOptions group options of the Push API
type RemoveOptions ¶
type RemoveOptions struct {
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
// Stop option passed in the command line
Stop bool
// Volumes remove anonymous volumes
Volumes bool
// Force don't ask to confirm removal
Force bool
// Services passed in the command line to be removed
Services []string
}
RemoveOptions group options of the Remove API
type RestartOptions ¶
type RestartOptions struct {
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
// Timeout override container restart timeout
Timeout *time.Duration
// Services passed in the command line to be restarted
Services []string
// NoDeps ignores services dependencies
NoDeps bool
}
RestartOptions group options of the Restart API
type RunOptions ¶
type RunOptions struct {
CreateOptions
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
Name string
Service string
Command []string
Entrypoint []string
Detach bool
AutoRemove bool
Tty bool
Interactive bool
WorkingDir string
User string
Environment []string
CapAdd []string
CapDrop []string
Labels types.Labels
Privileged bool
UseNetworkAliases bool
NoDeps bool
// used by exec
Index int
}
RunOptions group options of the Run API
type ScaleOptions ¶ added in v2.22.0
type ScaleOptions struct {
Services []string
}
type ServiceStatus ¶
type ServiceStatus struct {
ID string
Name string
Replicas int
Desired int
Ports []string
Publishers []PortPublisher
}
ServiceStatus hold status about a service
type StartOptions ¶
type StartOptions struct {
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
// Attach to container and forward logs if not nil
Attach LogConsumer
// AttachTo set the services to attach to
AttachTo []string
// OnExit defines behavior when a container stops
OnExit Cascade
// ExitCodeFrom return exit code from specified service
ExitCodeFrom string
// Wait won't return until containers reached the running|healthy state
Wait bool
WaitTimeout time.Duration
// Services passed in the command line to be started
Services []string
Watch bool
}
StartOptions group options of the Start API
type StopOptions ¶
type StopOptions struct {
// Project is the compose project used to define this app. Might be nil if user ran command just with project name
Project *types.Project
// Timeout override container stop timeout
Timeout *time.Duration
// Services passed in the command line to be stopped
Services []string
}
StopOptions group options of the Stop API
type Streams ¶ added in v2.15.0
Streams defines the standard streams (stdin, stdout, stderr) used by the CLI.
type UpOptions ¶
type UpOptions struct {
Create CreateOptions
Start StartOptions
}
UpOptions group options of the Up API
type VizOptions ¶ added in v2.18.0
type VizOptions struct {
// IncludeNetworks if true, network names a container is attached to should appear in the graph node
IncludeNetworks bool
// IncludePorts if true, ports a container exposes should appear in the graph node
IncludePorts bool
// IncludeImageName if true, name of the image used to create a container should appear in the graph node
IncludeImageName bool
// Indentation string to be used to indent graphviz code, e.g. "\t", " "
Indentation string
}
type VolumesOptions ¶ added in v2.38.0
type VolumesOptions struct {
Services []string
}
type VolumesSummary ¶ added in v2.38.0
type WaitOptions ¶ added in v2.20.0
type WatchOptions ¶ added in v2.16.0
type WatchOptions struct {
Build *BuildOptions
LogTo LogConsumer
Prune bool
Services []string
}
WatchOptions group options of the Watch API