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

Commit 4164d5b

Browse files
committed
add docker support via sbt-docker
1 parent 2d4f49e commit 4164d5b

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

build.sbt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "s3mock"
22

3-
version := "0.2.3"
3+
version := "0.2.4"
44

55
organization := "io.findify"
66

@@ -53,6 +53,22 @@ pomExtra := (
5353
</developer>
5454
</developers>)
5555

56+
enablePlugins(DockerPlugin)
57+
assemblyJarName in assembly := "s3mock.jar"
58+
mainClass in assembly := Some("io.findify.s3mock.Main")
59+
test in assembly := {}
60+
61+
dockerfile in docker := new Dockerfile {
62+
from("openjdk:9.0.1-11-jre-slim")
63+
expose(8001)
64+
add(assembly.value, "/app/s3mock.jar")
65+
entryPoint("java", "-Xmx128m", "-jar", "/app/s3mock.jar")
66+
}
67+
imageNames in docker := Seq(
68+
ImageName(s"findify/s3mock:${version.value.replaceAll("\\+", "_")}"),
69+
ImageName(s"findify/s3mock:latest")
70+
)
71+
5672
/*enablePlugins(JavaAppPackaging)
5773
5874
maintainer in Docker := "S3mock"

project/plugins.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
55
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
66
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")
77
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.4")
8-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.2")
8+
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.1")
9+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")

src/main/scala/io/findify/s3mock/S3Mock.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class S3Mock(port:Int, provider:Provider)(implicit system:ActorSystem = ActorSys
6161
}
6262

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

0 commit comments

Comments
 (0)