Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap docker labels with " character #1014

Merged
merged 4 commits into from
Aug 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ object DockerPlugin extends AutoPlugin {
* @param label
* @return LABEL command
*/
private final def makeLabel(label: Tuple2[String, String]): CmdLike = {
private final def makeLabel(label: (String, String)): CmdLike = {
val (variable, value) = label
Cmd("LABEL", s"${variable}=${value}")
Cmd("LABEL", variable + "=\"" + value.toString + "\"")
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/docker/labels/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ name := "simple-test"

version := "0.1.0"

dockerLabels := Map("foo" -> "bar", "Hello" -> "World")
dockerLabels := Map("foo" -> "foo", "fooBar" -> "foo bar", "number" -> "123")
5 changes: 3 additions & 2 deletions src/sbt-test/docker/labels/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Stage the distribution and ensure files show up.
> docker:stage
$ exec grep -q -F 'LABEL foo=bar' target/docker/Dockerfile
$ exec grep -q -F 'LABEL Hello=World' target/docker/Dockerfile
$ exec grep -q -F 'LABEL foo="bar"' target/docker/Dockerfile
$ exec grep -q -F 'LABEL fooBar="foo bar"' target/docker/Dockerfile
$ exec grep -q -F 'LABEL number="123"' target/docker/Dockerfile