Browse Source

Set watch option --prune=true as default

Signed-off-by: Remco Kranenburg <[email protected]>
Remco Kranenburg 8 months ago
parent
commit
b0badf1eb0

+ 1 - 1
cmd/compose/watch.go

@@ -59,7 +59,7 @@ func watchCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
 	}
 
 	cmd.Flags().BoolVar(&buildOpts.quiet, "quiet", false, "hide build output")
-	cmd.Flags().BoolVar(&watchOpts.prune, "prune", false, "Prune dangling images on rebuild")
+	cmd.Flags().BoolVar(&watchOpts.prune, "prune", true, "Prune dangling images on rebuild")
 	cmd.Flags().BoolVar(&watchOpts.noUp, "no-up", false, "Do not build & start services before watching")
 	return cmd
 }

+ 1 - 1
docs/reference/compose_watch.md

@@ -9,7 +9,7 @@ Watch build context for service and rebuild/refresh containers when files are up
 |:------------|:-------|:--------|:----------------------------------------------|
 | `--dry-run` | `bool` |         | Execute command in dry run mode               |
 | `--no-up`   | `bool` |         | Do not build & start services before watching |
-| `--prune`   | `bool` |         | Prune dangling images on rebuild              |
+| `--prune`   | `bool` | `true`  | Prune dangling images on rebuild              |
 | `--quiet`   | `bool` |         | hide build output                             |
 
 

+ 1 - 1
docs/reference/docker_compose_watch.yaml

@@ -19,7 +19,7 @@ options:
       swarm: false
     - option: prune
       value_type: bool
-      default_value: "false"
+      default_value: "true"
       description: Prune dangling images on rebuild
       deprecated: false
       hidden: false