Skip to content

Commit

Permalink
Merge pull request #582 from linehrr/feature/dockerization
Browse files Browse the repository at this point in the history
Feature/dockerization
  • Loading branch information
patelh authored Dec 17, 2018
2 parents 2140b5e + fe34f76 commit 4ce3f60
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,34 @@ enablePlugins(SbtNativePackager)

enablePlugins(SystemdPlugin)


enablePlugins(sbtdocker.DockerPlugin)
dockerfile in docker := {
val zipFile: File = dist.value

new Dockerfile {
from("openjdk:8-jre")
add(zipFile, file("/opt/kafka-manager.zip"))
workDir("/opt")
run("unzip", "kafka-manager.zip")
run("rm", "-f", "kafka-manager.zip")

expose(9000)

cmd(s"kafka-manager-${version.value}/bin/kafka-manager")
}
}

imageNames in docker := Seq(
ImageName(
s"${name.value}:${version.value}"
)
)

buildOptions in docker := BuildOptions(
pullBaseImage = BuildOptions.Pull.Always
)

/*
* Start service as user root
*/
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ resolvers += Classpaths.sbtPluginReleases
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.3")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0")

addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.5.0")

0 comments on commit 4ce3f60

Please sign in to comment.