Skip to content
Permalink
Browse files
fix(run): a container is not cleaned up after execution by default
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
  • Loading branch information
alexey-igrychev committed Sep 8, 2022
1 parent bc691f2 commit c04367c198cb8567164466758be237eb6ad546ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
@@ -53,7 +53,7 @@ func NewCmd(ctx context.Context) *cobra.Command {
Short: "Run container for project image",
Long: common.GetLongCommandDescription(`Run container for specified project image from werf.yaml (build if needed)`),
DisableFlagsInUseLine: true,
Example: ` # Run specified image
Example: ` # Run specified image and remove after execution
$ werf run application
# Run image with predefined docker run options and command for debug
@@ -105,6 +105,8 @@ func NewCmd(ctx context.Context) *cobra.Command {
common.PrintHelp(cmd)
return fmt.Errorf("shell option cannot be used with other docker run arguments")
}
} else if len(cmdData.DockerOptions) == 0 {
cmdData.DockerOptions = append(cmdData.DockerOptions, "--rm")
}

return runMain(ctx)
@@ -14,7 +14,7 @@ werf run [options] [IMAGE_NAME] [-- COMMAND ARG...]
{{ header }} Examples

```shell
# Run specified image
# Run specified image and remove after execution
$ werf run application
# Run image with predefined docker run options and command for debug

0 comments on commit c04367c

Please sign in to comment.