Skip to content

Commit

Permalink
remove image after build
Browse files Browse the repository at this point in the history
  • Loading branch information
timfeirg committed Sep 30, 2016
1 parent 56cbcc5 commit 57d16bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cluster/calcium/build_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (c *calcium) BuildImage(repository, version, uid, artifact string) (chan *t
ForceRemove: true,
PullParent: true,
}
log.Infof("Building image %v at %v:%v", tag, buildPodname, node.Name)
resp, err := node.Engine.ImageBuild(context.Background(), buildContext, buildOptions)
if err != nil {
return ch, err
Expand Down Expand Up @@ -219,6 +220,12 @@ func (c *calcium) BuildImage(repository, version, uid, artifact string) (chan *t
ch <- message
}

rmiOpts := enginetypes.ImageRemoveOptions{
Force: false,
PruneChildren: true,
}
go node.Engine.ImageRemove(context.Background(), tag, rmiOpts)

ch <- &types.BuildImageMessage{Status: "finished", Progress: tag}
close(ch)
}()
Expand Down

0 comments on commit 57d16bf

Please sign in to comment.