Merge pull request #1306 from aiordache/compose_exec_cmd

Add `compose exec` command
This commit is contained in:
Nicolas De loof 2021-02-16 14:15:48 +01:00 committed by GitHub
commit 5e7203dbe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 284 additions and 0 deletions

View file

@ -87,3 +87,7 @@ func (c *composeService) RunOneOffContainer(ctx context.Context, project *types.
func (c *composeService) Remove(ctx context.Context, project *types.Project, options compose.RemoveOptions) ([]string, error) {
return nil, errdefs.ErrNotImplemented
}
func (c *composeService) Exec(ctx context.Context, project *types.Project, opts compose.RunOptions) error {
return errdefs.ErrNotImplemented
}

View file

@ -56,6 +56,8 @@ type Service interface {
RunOneOffContainer(ctx context.Context, project *types.Project, opts RunOptions) (int, error)
// Remove executes the equivalent to a `compose rm`
Remove(ctx context.Context, project *types.Project, options RemoveOptions) ([]string, error)
// Exec executes a command in a running service container
Exec(ctx context.Context, project *types.Project, opts RunOptions) error
}
// CreateOptions group options of the Create API
@ -126,6 +128,14 @@ type RunOptions struct {
AutoRemove bool
Writer io.Writer
Reader io.Reader
// used by exec
Tty bool
WorkingDir string
User string
Environment []string
Privileged bool
Index int
}
// PsOptions group options of the Ps API