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

Use LABEL instead of MAINTAINER for maintainers #1034

Merged
merged 1 commit into from
Oct 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
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ libraryDependencies ++= {
"org.scala-sbt" %% "io" % "1.0.0",
// these dependencies have to be explicitly added by the user
// FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow
"com.spotify" % "docker-client" % "3.5.13" /* % "provided" */,
"com.spotify" % "docker-client" % "8.9.0" /* % "provided" */,
"org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar")
)
case _ =>
Seq(
// these dependencies have to be explicitly added by the user
"com.spotify" % "docker-client" % "3.5.13" % Provided,
"com.spotify" % "docker-client" % "8.9.0" % Provided,
"org.vafer" % "jdeb" % "1.3" % Provided artifacts Artifact("jdeb", "jar", "jar")
)
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.0.0
sbt.version=1.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ object DockerPlugin extends AutoPlugin {

/**
* @param maintainer (optional)
* @return MAINTAINER if defined
* @return LABEL MAINTAINER if defined
*/
private final def makeMaintainer(maintainer: String): Option[CmdLike] =
if (maintainer.isEmpty) None else Some(Cmd("MAINTAINER", maintainer))
if (maintainer.isEmpty) None else Some(makeLabel(Tuple2("MAINTAINER", maintainer)))

/**
* @param dockerBaseImage
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/docker/override-commands/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ maintainer := "Gary Coady <[email protected]>"
dockerUpdateLatest := true
dockerCommands := Seq(
Cmd("FROM", "openjdk:latest"),
Cmd("MAINTAINER", maintainer.value),
Cmd("LABEL", s"""MAINTAINER="${maintainer.value}""""),
ExecCmd("CMD", "echo", "Hello, World from Docker")
)
1 change: 1 addition & 0 deletions src/sbt-test/docker/override-commands/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generate the Docker image locally
> docker:publishLocal
$ exec bash -c 'docker run docker-commands:latest | grep -q "Hello, World from Docker"'
$ exec bash -c 'docker inspect -f "{{json .Config.Labels}}" docker-commands:latest | grep "MAINTAINER" | grep -q "Gary Coady"'
2 changes: 1 addition & 1 deletion src/sbt-test/docker/rmi/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generate the Docker image locally
> docker:publishLocal
$ exec bash -c 'docker images | grep rmi'
$ exec bash -c 'docker images | grep -q rmi'
> docker:clean
$ exec bash -c '[[ $(docker images) != *"rmi"* ]]'
6 changes: 3 additions & 3 deletions src/sphinx/formats/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Informational Settings
The version of the package for Docker (if different from general version). Often takes the form ``x.y.z``.

``maintainer in Docker``
The maintainer of the package, required by the Dockerfile format.
The maintainer of the package, recommended by the Dockerfile format.

Environment Settings
~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -230,7 +230,7 @@ In your sbt console type
.. code-block:: bash

> show dockerCommands
[info] List(Cmd(FROM,openjdk:latest), Cmd(MAINTAINER,Your Name <[email protected]>), ...)
[info] List(Cmd(FROM,openjdk:latest), Cmd(LABEL,MAINTAINER=Your Name <[email protected]>), ...)



Expand Down Expand Up @@ -299,7 +299,7 @@ Now let's start adding some Docker commands.

dockerCommands := Seq(
Cmd("FROM", "openjdk:latest"),
Cmd("MAINTAINER", maintainer.value),
Cmd("LABEL", s"""MAINTAINER="${maintainer.value}"""")
ExecCmd("CMD", "echo", "Hello, World from Docker")
)

Expand Down