Browse code

Add a Builder.Commit method

Guillaume J. Charmes authored on 2013/04/25 05:35:57
Showing 1 changed files
... ...
@@ -41,6 +41,10 @@ func (builder *Builder) Run(image *Image, cmd ...string) (*Container, error) {
41 41
 	return container, nil
42 42
 }
43 43
 
44
+func (builder *Builder) Commit(container *Container, repository, tag, comment, author string) (*Image, error) {
45
+	return builder.runtime.Commit(container.Id, repository, tag, comment, author)
46
+}
47
+
44 48
 func (builder *Builder) clearTmp(containers, images map[string]struct{}) {
45 49
 	for c := range containers {
46 50
 		tmp := builder.runtime.Get(c)
... ...
@@ -106,7 +110,7 @@ func (builder *Builder) Build(dockerfile io.Reader, stdout io.Writer) error {
106 106
 			}
107 107
 
108 108
 			// Commit the container
109
-			base, err := builder.runtime.Commit(c.Id, "", "", "", "")
109
+			base, err := builder.Commit(c, "", "", "", "")
110 110
 			if err != nil {
111 111
 				return err
112 112
 			}