Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
add docker support via sbt-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
shuttie committed Nov 7, 2017
1 parent 2d4f49e commit 4164d5b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 17 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "s3mock"

version := "0.2.3"
version := "0.2.4"

organization := "io.findify"

Expand Down Expand Up @@ -53,6 +53,22 @@ pomExtra := (
</developer>
</developers>)

enablePlugins(DockerPlugin)
assemblyJarName in assembly := "s3mock.jar"
mainClass in assembly := Some("io.findify.s3mock.Main")
test in assembly := {}

dockerfile in docker := new Dockerfile {
from("openjdk:9.0.1-11-jre-slim")
expose(8001)
add(assembly.value, "/app/s3mock.jar")
entryPoint("java", "-Xmx128m", "-jar", "/app/s3mock.jar")
}
imageNames in docker := Seq(
ImageName(s"findify/s3mock:${version.value.replaceAll("\\+", "_")}"),
ImageName(s"findify/s3mock:latest")
)

/*enablePlugins(JavaAppPackaging)
maintainer in Docker := "S3mock"
Expand Down
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.2")
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
1 change: 1 addition & 0 deletions src/main/scala/io/findify/s3mock/S3Mock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class S3Mock(port:Int, provider:Provider)(implicit system:ActorSystem = ActorSys
}

bind = Await.result(http.bindAndHandle(route, "0.0.0.0", port), Duration.Inf)
logger.info(s"bound to 0.0.0.0:$port")
bind
}

Expand Down

0 comments on commit 4164d5b

Please sign in to comment.