Merge pull request #4103 from vieux/add_error_build-rm

add error to docker build --rm
This commit is contained in:
Victor Vieux 2014-02-13 10:35:55 -08:00
commit 6f10f33387
1 changed files with 5 additions and 2 deletions

View File

@ -65,9 +65,12 @@ type buildFile struct {
func (b *buildFile) clearTmp(containers map[string]struct{}) { func (b *buildFile) clearTmp(containers map[string]struct{}) {
for c := range containers { for c := range containers {
tmp := b.runtime.Get(c) tmp := b.runtime.Get(c)
b.runtime.Destroy(tmp) if err := b.runtime.Destroy(tmp); err != nil {
fmt.Fprintf(b.outStream, "Error removing intermediate container %s: %s\n", utils.TruncateID(c), err.Error())
} else {
fmt.Fprintf(b.outStream, "Removing intermediate container %s\n", utils.TruncateID(c)) fmt.Fprintf(b.outStream, "Removing intermediate container %s\n", utils.TruncateID(c))
} }
}
} }
func (b *buildFile) CmdFrom(name string) error { func (b *buildFile) CmdFrom(name string) error {