--- a/REFERENCE.md Mon Sep 25 21:10:12 2017 -0500
+++ b/REFERENCE.md Tue Sep 26 09:51:15 2017 -0500
@@ -46,7 +46,7 @@
This example shows how to expand an environment variable into a list in the context of a extended task.
This example shows how you can login and logout of a Docker registry by using environment variables.
@@ -178,7 +178,11 @@
| dockerfile | Yes | | The dockerfile to use while building |
| files | | | A list of files that should be made available for the build |
| labels | | | A list of labels to set on the image being built |
-| tag | Yes | | The tag to apply to the image |
+| tag | | | The tag to apply to the image | +| tags | | | The list of tags as described above | +At least one tag must be supplied by either the `tag` or `tags` attribute. If both are +supplied, `tag` is inserted to the front of `tags`. --- a/docker/build.go Mon Sep 25 21:10:12 2017 -0500
+++ b/docker/build.go Tue Sep 26 09:51:15 2017 -0500
@@ -18,6 +18,7 @@
@@ -34,13 +35,14 @@
Dockerfile string `yaml:"dockerfile"`
Files yaml.StringOrSlice `yaml:"files"`
+ Tags yaml.StringOrSlice `yaml:"tags"` Labels yaml.StringOrSlice `yaml:"labels"`
Arguments yaml.StringOrSlice `yaml:"arguments"`
const buildTemplate = `build
-{{if .tag}} -t {{.tag}}{{end}}
+{{range .Tags}} -t {{.}}{{end}} {{range .Labels}} --label '{{.}}'{{end}}
{{range .Arguments}} --build-arg {{.}}{{end}}
@@ -80,15 +82,16 @@
"workspace": st.Workspace.Name(),
- err = Docker(name, exportTemplate, params, st)
+ if err := Docker(name, exportTemplate, params, st); err != nil { + tags, err := st.MapSlice(b.Tags, fullEnv) - tag, err := environment.Mapper(b.Tag, fullEnv)
+ fmt.Printf("Tags: %#v :: %#v\n", b.Tags, tags) labels, err := st.MapSlice(b.Labels, fullEnv)
@@ -103,8 +106,8 @@
params = map[string]interface{}{
"dockerfile": filepath.Join(tmpDir, filepath.Base(b.Dockerfile)),
@@ -121,7 +124,11 @@
+ b.Tags = append([]string{b.Tag}, b.Tags...)