nokostar
nokostar

Reputation: 103

SBT plugin to create image from a plain Docker text file

I want to build an image for a plain Dockerfile text, Is there an SBT plugin that will let me specify my own docker file.

Upvotes: 1

Views: 140

Answers (1)

Andrzej Sołtysik
Andrzej Sołtysik

Reputation: 320

I don't really see a need for a plugin here. The simplest way is to just create a sbt task which calls docker process in the shell. Doing so in sbt is quite simple, take a look at this answer: How to execute a bash script as sbt task?

Something like this:

lazy val yourDockerTask = taskKey[Unit]("Runs docker build")

yourDockerTask := {
  "docker build ." !
}

Then you can call the task you just created from the sbt shell.

Upvotes: 3

Related Questions