Search code examples
scaladockersbtsbt-native-packager

SBT native packager does not copy file to Docker image


I have an Akka SBT project. It consists of multiple SBT submodules:

  • common contains resources/logback-prod.xml
  • app depends on two other submodules
  • postgres

I build a docker image of the project. The only command which does not affect the image is:

...
dockerPackageMappings in Docker += 
   ((resourceDirectory in Compile).value / "logback-prod.xml") -> "/opt/docker/conf/logback-prod.xml"
...

This line of code does not copy the logback-prod.xml from the common subproject to the docker /opt/docker/conf/ path

Instead it creates a directory with name "logback-prod.xml" by the path I mentioned above.

What I'm doing wrong?


Solution

  • The problem is solved by this line of code:

    mappings in Docker += (resourceDirectory in common in Compile).value / "logback-prod.xml" -> "/opt/docker/conf/logback-prod.xml",