Signed-off-by: Guillaume Lours <[email protected]>
@@ -79,5 +79,6 @@ func runRemove(ctx context.Context, backend api.Service, opts removeOptions, ser
Force: opts.force,
Volumes: opts.volumes,
Project: project,
+ Stop: opts.stop,
})
}
@@ -229,8 +229,8 @@ type KillOptions struct {
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
- // DryRun just list removable resources
- DryRun bool
+ // Stop option passed in the command line
+ Stop bool
// Volumes remove anonymous volumes
Volumes bool
// Force don't ask to confirm removal
@@ -77,7 +77,7 @@ func (d *DryRunClient) ContainerPause(ctx context.Context, container string) err
func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options moby.ContainerRemoveOptions) error {
- return ErrNotImplemented
+ return nil
func (d *DryRunClient) ContainerRename(ctx context.Context, container, newContainerName string) error {
@@ -45,7 +45,7 @@ func (s *composeService) Remove(ctx context.Context, projectName string, options
stoppedContainers := containers.filter(func(c moby.Container) bool {
- return c.State != ContainerRunning
+ return c.State != ContainerRunning || (options.Stop && s.dryRun)
var names []string