mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
default to deleting images via the remote api
This makes the remote API version 1.12 and newer default to automatically deleting intermediate containers when the build has succeedeed. Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
This commit is contained in:
@ -198,6 +198,8 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
|||||||
}
|
}
|
||||||
if *rm {
|
if *rm {
|
||||||
v.Set("rm", "1")
|
v.Set("rm", "1")
|
||||||
|
} else {
|
||||||
|
v.Set("rm", "0")
|
||||||
}
|
}
|
||||||
|
|
||||||
if *forceRm {
|
if *forceRm {
|
||||||
|
@ -903,8 +903,11 @@ func postBuild(eng *engine.Engine, version version.Version, w http.ResponseWrite
|
|||||||
} else {
|
} else {
|
||||||
job.Stdout.Add(utils.NewWriteFlusher(w))
|
job.Stdout.Add(utils.NewWriteFlusher(w))
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.FormValue("forcerm") == "1" && version.GreaterThanOrEqualTo("1.12") {
|
if r.FormValue("forcerm") == "1" && version.GreaterThanOrEqualTo("1.12") {
|
||||||
job.Setenv("rm", "1")
|
job.Setenv("rm", "1")
|
||||||
|
} else if r.FormValue("rm") == "" && version.GreaterThanOrEqualTo("1.12") {
|
||||||
|
job.Setenv("rm", "1")
|
||||||
} else {
|
} else {
|
||||||
job.Setenv("rm", r.FormValue("rm"))
|
job.Setenv("rm", r.FormValue("rm"))
|
||||||
}
|
}
|
||||||
|
@ -1063,7 +1063,7 @@ Build an image from Dockerfile via stdin
|
|||||||
the resulting image in case of success
|
the resulting image in case of success
|
||||||
- **q** – suppress verbose build output
|
- **q** – suppress verbose build output
|
||||||
- **nocache** – do not use the cache when building the image
|
- **nocache** – do not use the cache when building the image
|
||||||
- **rm** - remove intermediate containers after a successful build
|
- **rm** - remove intermediate containers after a successful build (default behavior)
|
||||||
- **forcerm - always remove intermediate containers (includes rm)
|
- **forcerm - always remove intermediate containers (includes rm)
|
||||||
|
|
||||||
Request Headers:
|
Request Headers:
|
||||||
|
Reference in New Issue
Block a user