1
0
mirror of https://github.com/docker/compose-cli.git synced 2026-10-23 18:09:06 +03:00

Merge pull request #1505 from aiordache/image_cmd

Add `compose images` cmd
This commit is contained in:
Guillaume Tardif
2021-04-08 11:24:35 +02:00
committed by GitHub
10 changed files with 279 additions and 0 deletions

View File

@@ -115,3 +115,7 @@ func (c *composeService) Events(ctx context.Context, project string, options com
func (c *composeService) Port(ctx context.Context, project string, service string, port int, options compose.PortOptions) (string, int, error) {
return "", 0, errdefs.ErrNotImplemented
}
func (c *composeService) Images(ctx context.Context, projectName string, options compose.ImagesOptions) ([]compose.ImageSummary, error) {
return nil, errdefs.ErrNotImplemented
}

View File

@@ -72,6 +72,8 @@ type Service interface {
Events(ctx context.Context, project string, options EventsOptions) error
// Port executes the equivalent to a `compose port`
Port(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error)
// Images executes the equivalent of a `compose images`
Images(ctx context.Context, projectName string, options ImagesOptions) ([]ImageSummary, error)
}
// BuildOptions group options of the Build API
@@ -164,6 +166,11 @@ type PullOptions struct {
IgnoreFailures bool
}
// ImagesOptions group options of the Images API
type ImagesOptions struct {
Services []string
}
// KillOptions group options of the Kill API
type KillOptions struct {
// Signal to send to containers
@@ -285,6 +292,15 @@ type ContainerProcSummary struct {
Titles []string
}
// ImageSummary holds container image description
type ImageSummary struct {
ID string
ContainerName string
Repository string
Tag string
Size int64
}
// ServiceStatus hold status about a service
type ServiceStatus struct {
ID string