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 BuildOptions
- 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 moby.BuildCachePruneOptions) (*moby.BuildCachePruneReport, 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) (moby.ConfigCreateResponse, error)
- func (d *DryRunClient) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error)
- func (d *DryRunClient) ConfigList(ctx context.Context, options moby.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) (moby.IDResponse, 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 moby.ExecStartCheck) (moby.HijackedResponse, error)
- func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config moby.ExecConfig) (moby.IDResponse, error)
- func (d *DryRunClient) ContainerExecInspect(ctx context.Context, execID string) (moby.ContainerExecInspect, error)
- func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options containerType.ResizeOptions) error
- func (d *DryRunClient) ContainerExecStart(ctx context.Context, execID string, config moby.ExecStartCheck) error
- func (d *DryRunClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
- func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (moby.ContainerJSON, error)
- func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (moby.ContainerJSON, []byte, error)
- func (d *DryRunClient) ContainerKill(ctx context.Context, container, signal string) error
- func (d *DryRunClient) ContainerList(ctx context.Context, options containerType.ListOptions) ([]moby.Container, 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) (moby.ContainerPathStat, error)
- func (d *DryRunClient) ContainerStats(ctx context.Context, container string, stream bool) (moby.ContainerStats, error)
- func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container string) (moby.ContainerStats, 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.ContainerTopOKBody, error)
- func (d *DryRunClient) ContainerUnpause(ctx context.Context, container string) error
- func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.ContainerUpdateOKBody, 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) (moby.ContainersPruneReport, error)
- func (d *DryRunClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, moby.ContainerPathStat, 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 moby.EventsOptions) (<-chan events.Message, <-chan error)
- func (d *DryRunClient) HTTPClient() *http.Client
- func (d *DryRunClient) ImageBuild(ctx context.Context, reader io.Reader, options moby.ImageBuildOptions) (moby.ImageBuildResponse, error)
- func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string, options moby.ImageCreateOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string) ([]image.HistoryResponseItem, error)
- func (d *DryRunClient) ImageImport(ctx context.Context, source moby.ImageImportSource, ref string, ...) (io.ReadCloser, error)
- func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (moby.ImageInspect, []byte, error)
- func (d *DryRunClient) ImageList(ctx context.Context, options moby.ImageListOptions) ([]image.Summary, error)
- func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (moby.ImageLoadResponse, error)
- func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options moby.ImagePullOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options moby.ImagePushOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options moby.ImageRemoveOptions) ([]image.DeleteResponse, error)
- func (d *DryRunClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
- func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options moby.ImageSearchOptions) ([]registry.SearchResult, error)
- func (d *DryRunClient) ImageTag(ctx context.Context, imageName, ref string) error
- func (d *DryRunClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (moby.ImagesPruneReport, 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 moby.NetworkCreate) (moby.NetworkCreateResponse, error)
- func (d *DryRunClient) NetworkDisconnect(ctx context.Context, networkName, container string, force bool) error
- func (d *DryRunClient) NetworkInspect(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, error)
- func (d *DryRunClient) NetworkInspectWithRaw(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, []byte, error)
- func (d *DryRunClient) NetworkList(ctx context.Context, options moby.NetworkListOptions) ([]moby.NetworkResource, error)
- func (d *DryRunClient) NetworkRemove(ctx context.Context, networkName string) error
- func (d *DryRunClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (moby.NetworksPruneReport, error)
- func (d *DryRunClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error)
- func (d *DryRunClient) NodeList(ctx context.Context, options moby.NodeListOptions) ([]swarm.Node, error)
- func (d *DryRunClient) NodeRemove(ctx context.Context, nodeID string, options moby.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) (moby.SecretCreateResponse, error)
- func (d *DryRunClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error)
- func (d *DryRunClient) SecretList(ctx context.Context, options moby.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 moby.ServiceInspectOptions) (swarm.Service, []byte, error)
- func (d *DryRunClient) ServiceList(ctx context.Context, options moby.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) (moby.SwarmUnlockKeyResponse, 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 moby.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) (moby.VolumesPruneReport, error)
- type DryRunKey
- type Event
- type EventsOptions
- type ImageSummary
- type ImagesOptions
- type Interceptor
- 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 Service
- type ServiceProxy
- func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error
- func (s *ServiceProxy) Config(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error)
- func (s *ServiceProxy) Copy(ctx context.Context, projectName string, options CopyOptions) error
- func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error
- func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error
- func (s *ServiceProxy) DryRunMode(ctx context.Context, dryRun bool) (context.Context, error)
- func (s *ServiceProxy) Events(ctx context.Context, projectName string, options EventsOptions) error
- func (s *ServiceProxy) Exec(ctx context.Context, projectName string, options RunOptions) (int, error)
- func (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error)
- func (s *ServiceProxy) Kill(ctx context.Context, projectName string, options KillOptions) error
- func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error)
- func (s *ServiceProxy) Logs(ctx context.Context, projectName string, consumer LogConsumer, ...) error
- func (s *ServiceProxy) MaxConcurrency(i int)
- func (s *ServiceProxy) Pause(ctx context.Context, projectName string, options PauseOptions) error
- func (s *ServiceProxy) Port(ctx context.Context, projectName string, service string, port uint16, ...) (string, int, error)
- func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error)
- func (s *ServiceProxy) Publish(ctx context.Context, project *types.Project, repository string, ...) error
- func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error
- func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error
- func (s *ServiceProxy) Remove(ctx context.Context, projectName string, options RemoveOptions) error
- func (s *ServiceProxy) Restart(ctx context.Context, projectName string, options RestartOptions) error
- func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error)
- func (s *ServiceProxy) Scale(ctx context.Context, project *types.Project, options ScaleOptions) error
- func (s *ServiceProxy) Start(ctx context.Context, projectName string, options StartOptions) error
- func (s *ServiceProxy) Stop(ctx context.Context, projectName string, options StopOptions) error
- func (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error)
- func (s *ServiceProxy) UnPause(ctx context.Context, projectName string, options PauseOptions) error
- func (s *ServiceProxy) Up(ctx context.Context, project *types.Project, options UpOptions) error
- func (s *ServiceProxy) Viz(ctx context.Context, project *types.Project, options VizOptions) (string, error)
- func (s *ServiceProxy) Wait(ctx context.Context, projectName string, options WaitOptions) (int64, error)
- func (s *ServiceProxy) Watch(ctx context.Context, project *types.Project, services []string, ...) error
- func (s *ServiceProxy) WithInterceptor(interceptors ...Interceptor) *ServiceProxy
- func (s *ServiceProxy) WithService(service Service) *ServiceProxy
- type ServiceStatus
- type Stack
- type StartOptions
- type StopOptions
- type Streams
- type UpOptions
- type VizOptions
- 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 // ContainerEventAttach is a ContainerEvent of type attach. First event sent about a container ContainerEventAttach // ContainerEventStopped is a ContainerEvent of type stopped. ContainerEventStopped // ContainerEventRecreated let consumer know container stopped but his being replaced ContainerEventRecreated // ContainerEventExit is a ContainerEvent of type exit. ExitCode is set ContainerEventExit // UserCancel user cancelled compose up, we are stopping containers UserCancel )
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 )
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 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 // 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 }
BuildOptions group options of the Build API
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 // Container 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. Container string ID string Service string Line string // ContainerEventExit only 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 ¶
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 gracelfuly stop before sending SIGKILL Timeout *time.Duration // QuietPull makes the pulling process quiet QuietPull 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 moby.BuildCachePruneOptions) (*moby.BuildCachePruneReport, 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) (moby.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 moby.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) (moby.IDResponse, 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 moby.ExecStartCheck) (moby.HijackedResponse, error)
func (*DryRunClient) ContainerExecCreate ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config moby.ExecConfig) (moby.IDResponse, error)
func (*DryRunClient) ContainerExecInspect ¶ added in v2.16.0
func (d *DryRunClient) ContainerExecInspect(ctx context.Context, execID string) (moby.ContainerExecInspect, 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 moby.ExecStartCheck) 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) (moby.ContainerJSON, error)
func (*DryRunClient) ContainerInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (moby.ContainerJSON, []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) ([]moby.Container, 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) (moby.ContainerPathStat, error)
func (*DryRunClient) ContainerStats ¶ added in v2.16.0
func (d *DryRunClient) ContainerStats(ctx context.Context, container string, stream bool) (moby.ContainerStats, error)
func (*DryRunClient) ContainerStatsOneShot ¶ added in v2.16.0
func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container string) (moby.ContainerStats, 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.ContainerTopOKBody, 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.ContainerUpdateOKBody, 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) (moby.ContainersPruneReport, error)
func (*DryRunClient) CopyFromContainer ¶ added in v2.16.0
func (d *DryRunClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, moby.ContainerPathStat, error)
func (*DryRunClient) CopyToContainer ¶ added in v2.16.0
func (d *DryRunClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options moby.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 moby.EventsOptions) (<-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 moby.ImageBuildOptions) (moby.ImageBuildResponse, error)
func (*DryRunClient) ImageCreate ¶ added in v2.16.0
func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string, options moby.ImageCreateOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageHistory ¶ added in v2.16.0
func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string) ([]image.HistoryResponseItem, error)
func (*DryRunClient) ImageImport ¶ added in v2.16.0
func (d *DryRunClient) ImageImport(ctx context.Context, source moby.ImageImportSource, ref string, options moby.ImageImportOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (moby.ImageInspect, []byte, error)
func (*DryRunClient) ImageList ¶ added in v2.16.0
func (d *DryRunClient) ImageList(ctx context.Context, options moby.ImageListOptions) ([]image.Summary, error)
func (*DryRunClient) ImageLoad ¶ added in v2.16.0
func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (moby.ImageLoadResponse, error)
func (*DryRunClient) ImagePull ¶ added in v2.16.0
func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options moby.ImagePullOptions) (io.ReadCloser, error)
func (*DryRunClient) ImagePush ¶ added in v2.16.0
func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options moby.ImagePushOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageRemove ¶ added in v2.16.0
func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options moby.ImageRemoveOptions) ([]image.DeleteResponse, error)
func (*DryRunClient) ImageSave ¶ added in v2.16.0
func (d *DryRunClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
func (*DryRunClient) ImageSearch ¶ added in v2.16.0
func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options moby.ImageSearchOptions) ([]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) (moby.ImagesPruneReport, 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 moby.NetworkCreate) (moby.NetworkCreateResponse, 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 moby.NetworkInspectOptions) (moby.NetworkResource, error)
func (*DryRunClient) NetworkInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) NetworkInspectWithRaw(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, []byte, error)
func (*DryRunClient) NetworkList ¶ added in v2.16.0
func (d *DryRunClient) NetworkList(ctx context.Context, options moby.NetworkListOptions) ([]moby.NetworkResource, 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) (moby.NetworksPruneReport, 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 moby.NodeListOptions) ([]swarm.Node, error)
func (*DryRunClient) NodeRemove ¶ added in v2.16.0
func (d *DryRunClient) NodeRemove(ctx context.Context, nodeID string, options moby.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) (moby.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 moby.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 moby.ServiceCreateOptions) (swarm.ServiceCreateResponse, error)
func (*DryRunClient) ServiceInspectWithRaw ¶ added in v2.16.0
func (d *DryRunClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options moby.ServiceInspectOptions) (swarm.Service, []byte, error)
func (*DryRunClient) ServiceList ¶ added in v2.16.0
func (d *DryRunClient) ServiceList(ctx context.Context, options moby.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 moby.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
func (*DryRunClient) SwarmGetUnlockKey ¶ added in v2.16.0
func (d *DryRunClient) SwarmGetUnlockKey(ctx context.Context) (moby.SwarmUnlockKeyResponse, 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 moby.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) (moby.VolumesPruneReport, 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 ¶
EventsOptions group options of the Events API
type ImageSummary ¶
ImageSummary holds container image description
type ImagesOptions ¶
type ImagesOptions struct {
Services []string
}
ImagesOptions group options of the Images API
type Interceptor ¶
Interceptor allow to customize the compose types.Project before the actual Service method is executed
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 }
KillOptions group options of the Kill API
type LogConsumer ¶
type LogConsumer interface { Log(containerName, message string) Err(containerName, message string) Status(container, msg string) Register(container 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 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 { Build *BuildOptions // 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 // QuietPull makes the pulling process quiet QuietPull 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 Service ¶
type Service 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) // Config executes the equivalent to a `compose config` Config(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, 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) // 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) ([]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, services []string, 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 }
Service manages a compose project
type ServiceProxy ¶
type ServiceProxy struct { BuildFn func(ctx context.Context, project *types.Project, options BuildOptions) error PushFn func(ctx context.Context, project *types.Project, options PushOptions) error PullFn func(ctx context.Context, project *types.Project, opts PullOptions) error CreateFn func(ctx context.Context, project *types.Project, opts CreateOptions) error StartFn func(ctx context.Context, projectName string, options StartOptions) error RestartFn func(ctx context.Context, projectName string, options RestartOptions) error StopFn func(ctx context.Context, projectName string, options StopOptions) error UpFn func(ctx context.Context, project *types.Project, options UpOptions) error DownFn func(ctx context.Context, projectName string, options DownOptions) error LogsFn func(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error PsFn func(ctx context.Context, projectName string, options PsOptions) ([]ContainerSummary, error) ListFn func(ctx context.Context, options ListOptions) ([]Stack, error) ConfigFn func(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error) KillFn func(ctx context.Context, project string, options KillOptions) error RunOneOffContainerFn func(ctx context.Context, project *types.Project, opts RunOptions) (int, error) RemoveFn func(ctx context.Context, project string, options RemoveOptions) error ExecFn func(ctx context.Context, project string, opts RunOptions) (int, error) CopyFn func(ctx context.Context, project string, options CopyOptions) error PauseFn func(ctx context.Context, project string, options PauseOptions) error UnPauseFn func(ctx context.Context, project string, options PauseOptions) error TopFn func(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error) EventsFn func(ctx context.Context, project string, options EventsOptions) error PortFn func(ctx context.Context, project string, service string, port uint16, options PortOptions) (string, int, error) ImagesFn func(ctx context.Context, projectName string, options ImagesOptions) ([]ImageSummary, error) WatchFn func(ctx context.Context, project *types.Project, services []string, options WatchOptions) error MaxConcurrencyFn func(parallel int) DryRunModeFn func(ctx context.Context, dryRun bool) (context.Context, error) VizFn func(ctx context.Context, project *types.Project, options VizOptions) (string, error) WaitFn func(ctx context.Context, projectName string, options WaitOptions) (int64, error) PublishFn func(ctx context.Context, project *types.Project, repository string, options PublishOptions) error ScaleFn func(ctx context.Context, project *types.Project, options ScaleOptions) error // contains filtered or unexported fields }
ServiceProxy implements Service by delegating to implementation functions. This allows lazy init and per-method overrides
func (*ServiceProxy) Build ¶
func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error
Build implements Service interface
func (*ServiceProxy) Config ¶ added in v2.16.0
func (s *ServiceProxy) Config(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error)
Config implements Service interface
func (*ServiceProxy) Copy ¶
func (s *ServiceProxy) Copy(ctx context.Context, projectName string, options CopyOptions) error
Copy implements Service interface
func (*ServiceProxy) Create ¶
func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error
Create implements Service interface
func (*ServiceProxy) Down ¶
func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error
Down implements Service interface
func (*ServiceProxy) DryRunMode ¶ added in v2.16.0
func (*ServiceProxy) Events ¶
func (s *ServiceProxy) Events(ctx context.Context, projectName string, options EventsOptions) error
Events implements Service interface
func (*ServiceProxy) Exec ¶
func (s *ServiceProxy) Exec(ctx context.Context, projectName string, options RunOptions) (int, error)
Exec implements Service interface
func (*ServiceProxy) Images ¶
func (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error)
Images implements Service interface
func (*ServiceProxy) Kill ¶
func (s *ServiceProxy) Kill(ctx context.Context, projectName string, options KillOptions) error
Kill implements Service interface
func (*ServiceProxy) List ¶
func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error)
List implements Service interface
func (*ServiceProxy) Logs ¶
func (s *ServiceProxy) Logs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error
Logs implements Service interface
func (*ServiceProxy) MaxConcurrency ¶ added in v2.14.1
func (s *ServiceProxy) MaxConcurrency(i int)
func (*ServiceProxy) Pause ¶
func (s *ServiceProxy) Pause(ctx context.Context, projectName string, options PauseOptions) error
Pause implements Service interface
func (*ServiceProxy) Port ¶
func (s *ServiceProxy) Port(ctx context.Context, projectName string, service string, port uint16, options PortOptions) (string, int, error)
Port implements Service interface
func (*ServiceProxy) Ps ¶
func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error)
Ps implements Service interface
func (*ServiceProxy) Publish ¶ added in v2.22.0
func (s *ServiceProxy) Publish(ctx context.Context, project *types.Project, repository string, options PublishOptions) error
func (*ServiceProxy) Pull ¶
func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error
Pull implements Service interface
func (*ServiceProxy) Push ¶
func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error
Push implements Service interface
func (*ServiceProxy) Remove ¶
func (s *ServiceProxy) Remove(ctx context.Context, projectName string, options RemoveOptions) error
Remove implements Service interface
func (*ServiceProxy) Restart ¶
func (s *ServiceProxy) Restart(ctx context.Context, projectName string, options RestartOptions) error
Restart implements Service interface
func (*ServiceProxy) RunOneOffContainer ¶
func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error)
RunOneOffContainer implements Service interface
func (*ServiceProxy) Scale ¶ added in v2.22.0
func (s *ServiceProxy) Scale(ctx context.Context, project *types.Project, options ScaleOptions) error
func (*ServiceProxy) Start ¶
func (s *ServiceProxy) Start(ctx context.Context, projectName string, options StartOptions) error
Start implements Service interface
func (*ServiceProxy) Stop ¶
func (s *ServiceProxy) Stop(ctx context.Context, projectName string, options StopOptions) error
Stop implements Service interface
func (*ServiceProxy) Top ¶
func (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error)
Top implements Service interface
func (*ServiceProxy) UnPause ¶
func (s *ServiceProxy) UnPause(ctx context.Context, projectName string, options PauseOptions) error
UnPause implements Service interface
func (*ServiceProxy) Viz ¶ added in v2.18.0
func (s *ServiceProxy) Viz(ctx context.Context, project *types.Project, options VizOptions) (string, error)
Viz implements Service interface
func (*ServiceProxy) Wait ¶ added in v2.20.0
func (s *ServiceProxy) Wait(ctx context.Context, projectName string, options WaitOptions) (int64, error)
Wait implements Service interface
func (*ServiceProxy) Watch ¶ added in v2.16.0
func (s *ServiceProxy) Watch(ctx context.Context, project *types.Project, services []string, options WatchOptions) error
Watch implements Service interface
func (*ServiceProxy) WithInterceptor ¶
func (s *ServiceProxy) WithInterceptor(interceptors ...Interceptor) *ServiceProxy
WithInterceptor configures Interceptor to be applied to Service method execution
func (*ServiceProxy) WithService ¶
func (s *ServiceProxy) WithService(service Service) *ServiceProxy
WithService configure proxy to use specified Service as delegate
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 // CascadeStop stops the application when a container stops CascadeStop bool // 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 }
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 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 WaitOptions ¶ added in v2.20.0
type WatchOptions ¶ added in v2.16.0
type WatchOptions struct {
Build BuildOptions
}
WatchOptions group options of the Watch API