feat: remove container only if auto-remove is true

This commit is contained in:
fengcaiwen
2023-09-02 08:42:13 +08:00
parent 7ee9925d5e
commit c1d1bacef0
12 changed files with 130 additions and 40 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
log "github.com/sirupsen/logrus"
)
type RunOptions struct {
@@ -87,6 +88,7 @@ func reportError(stderr io.Writer, name string, str string, withHelp bool) {
if withHelp {
str += "\nSee 'docker " + name + " --help'."
}
log.Error(str)
_, _ = fmt.Fprintln(stderr, "docker:", str)
}