summaryrefslogtreecommitdiff
path: root/server/buildfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/buildfile.go')
-rw-r--r--server/buildfile.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/buildfile.go b/server/buildfile.go
index 5b94c9423a..71fed660b2 100644
--- a/server/buildfile.go
+++ b/server/buildfile.go
@@ -17,6 +17,7 @@ import (
"sort"
"strings"
"syscall"
+ "time"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/daemon"
@@ -696,7 +697,7 @@ func (b *buildFile) run(c *daemon.Container) error {
}
// Wait for it to finish
- if ret := c.Wait(); ret != 0 {
+ if ret, _ := c.State.WaitStop(-1 * time.Second); ret != 0 {
err := &utils.JSONError{
Message: fmt.Sprintf("The command %v returned a non-zero code: %d", b.config.Cmd, ret),
Code: ret,
@@ -751,7 +752,7 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
autoConfig := *b.config
autoConfig.Cmd = autoCmd
// Commit the container
- image, err := b.daemon.Commit(container, "", "", "", b.maintainer, &autoConfig)
+ image, err := b.daemon.Commit(container, "", "", "", b.maintainer, true, &autoConfig)
if err != nil {
return err
}
@@ -761,7 +762,7 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
}
// Long lines can be split with a backslash
-var lineContinuation = regexp.MustCompile(`\s*\\\s*\n`)
+var lineContinuation = regexp.MustCompile(`\\\s*\n`)
func (b *buildFile) Build(context io.Reader) (string, error) {
tmpdirPath, err := ioutil.TempDir("", "docker-build")