sbt-native-packager
sbt-native-packager copied to clipboard
Docker plugin doesn't copy files into image.
Expected behaviour
When working with DockerPlugin, files in mapping aren't being copied to the image. I'm working with assembly plugin to create a fat jar, then adding it to Docker/mappings. (without archetype).
lazy val dockerSettings = Seq(Docker / mappings ++= Seq((assembly / assemblyOutputPath).value -> "/opt/tech/jobs/job.jar"))
...
.enablePlugins(DockerPlugin)
.settings(dockerSettings)
From sbt shell Docker/stage creates a Dockerfile and a directory with the jar from mappings.
Mappings from sbt shell shows the tuple.
When Docker/publishLocal file is not being copied to the target directory.
Information
- sbt-native-packager 1.9.5
- sbt 1.5.5
- MacOs
- Docker 20.10.5
- Minikube
Hi @rapid-roman
Thanks for your issue report.
I would guess that the ordering of your settings is wrong or the scope.
- Enable the plugins first. SBT applies settings in order. However I'm not too sure about plugins.
- Use
Universal / mappings. This setting is definitely used. I can't remember off the top of my head of this is added to the docker mappings ( which it definitely should )
@muuki88 I switched to the Universal / mappings instead of Docker / mappings and it fixed the issue.
Not sure if the described behaviour is a bug or by design, since I enabled the plugin before the setting (see above).
Thanks.