From 7bccdc0d33d0589792b9b867b13c9e50dcf48358 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Wed, 24 Apr 2013 13:35:57 -0700 Subject: [PATCH] Add a Builder.Commit method --- builder.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builder.go b/builder.go index cbc8711aa7..b15a71d621 100644 --- a/builder.go +++ b/builder.go @@ -41,6 +41,10 @@ func (builder *Builder) Run(image *Image, cmd ...string) (*Container, error) { return container, nil } +func (builder *Builder) Commit(container *Container, repository, tag, comment, author string) (*Image, error) { + return builder.runtime.Commit(container.Id, repository, tag, comment, author) +} + func (builder *Builder) clearTmp(containers, images map[string]struct{}) { for c := range containers { tmp := builder.runtime.Get(c) @@ -106,7 +110,7 @@ func (builder *Builder) Build(dockerfile io.Reader, stdout io.Writer) error { } // Commit the container - base, err := builder.runtime.Commit(c.Id, "", "", "", "") + base, err := builder.Commit(c, "", "", "", "") if err != nil { return err }