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.
Asked
Active
Viewed 134 times
1 Answers
3
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.

Andrzej Sołtysik
- 300
- 5
- 18
-
1Note that you can specify a custom Dockerfile name using `docker build -f your_docker_file .` – francoisr Jan 25 '19 at 11:10