Joe
Joe

Reputation: 2633

What to add to my sbt to support Docker image creation for non-play project?

I have a regular project (not play) and I want to create docker image for this project....how can I do it?

I tried something like this:

dockerRepository := Some("docker-docker-local.artifactoryonline.com")

dockerUpdateLatest := true

dockerEntrypoint := Seq("bin/%s" format executableScriptName.value, "-J-Xms1024M", "-J-Xmx2048m", "-J-server")

but dockerRepository,dockerUpdateLatest and dockerEntrypoint are not familiare in my proj, I need to import something but I dont know what.

I also have a jfrog account to save my artifactory (this is why I added the url).

What is the best way to do it?

thanksss!@

Upvotes: 1

Views: 186

Answers (1)

lutzh
lutzh

Reputation: 4965

You'll need to add an sbt plugin that supports Docker image creation to your build. Check out sbt-native-packager. To use it, add it to your project/plugins.sbt

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6")

Then in your build.sbt, enable Docker support

enablePlugins(DockerPlugin)

After that, your settings should be recognized, and you have the following tasks available:

docker:publishLocal

Build a Docker image

docker:publish

Build image and publish to configured repository

See the full documentation at http://www.scala-sbt.org/sbt-native-packager/ and http://www.scala-sbt.org/sbt-native-packager/formats/docker.html

There's also a mailing list: https://groups.google.com/forum/?hl=en#!forum/sbt-native-packager

Upvotes: 1

Related Questions