1

我想为纯 Dockerfile 文本构建图像,是否有 SBT 插件可以让我指定自己的 docker 文件。

4

1 回答 1

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.

于 2019-01-24T20:20:14.607 回答