[SOLVED] Sbt native packager multiple dockerfiles


#1

Do not find similar threads here and in old google user group. So posting here.

I can use sbt native packager publish docker image locally using command sbt docker:publishLocal.

Now a new requirement is I want to create multiple dockers (each encapsulates a particular service such as postgresql, mongo, elasticsearch, and so on). However I do not find any examples that explain how to add multiple docker files so I can publish and launch services at once.

Checking sbt native packager source code shows there is DockerPlugin.scala where Dockerfile is specified, but seemingly no usage showing how to specify multiple dockerfiles.

Does this mean for each sbt native packager project, only 1 docker (dockerfile) can be created? If that’s not the case, how can I specify multiple docker files to create dockers?

Thanks


#2

This is a native packager question. Stackoverflow would be more suitable.

I personally would have multiple sbt sub projects for multiple targets.


#3

Get it. Thanks for helping out!