bump remote api to 1.12 & add --force-rm to build

This adds a `--force-rm` flag to docker build which makes the Docker
daemon clean up all containers, even when the build has failed.

This new flag requires that we bump the remote API, so we also bump the
remote API version.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
This commit is contained in:
unclejack
2014-05-19 23:10:49 +03:00
parent e39299ca1d
commit 667e2bd4ea
9 changed files with 1400 additions and 10 deletions
+5
View File
@@ -110,6 +110,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
suppressOutput := cmd.Bool([]string{"q", "-quiet"}, false, "Suppress the verbose output generated by the containers")
noCache := cmd.Bool([]string{"#no-cache", "-no-cache"}, false, "Do not use cache when building the image")
rm := cmd.Bool([]string{"#rm", "-rm"}, true, "Remove intermediate containers after a successful build")
forceRm := cmd.Bool([]string{"-force-rm"}, false, "Always remove intermediate containers, even after unsuccessful builds")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -199,6 +200,10 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
v.Set("rm", "1")
}
if *forceRm {
v.Set("forcerm", "1")
}
cli.LoadConfigFile()
headers := http.Header(make(map[string][]string))