-
-
Notifications
You must be signed in to change notification settings - Fork 286
Description
Hi everyone,
I'm in the process of migrating an in-house setup that integrates rules_scala, rules_docker, and rules_k8s into a cohesive set of rules for producing Scala-based microservices. As part of this migration, I've updated from rules_docker to rules_oci and moved to a fork of rules_k8s that works with rules_oci. However, I'm now facing a significant challenge with the final piece: creating functional Docker images for the microservices.
The documentation at rules_oci and rules_scala doesn't mention fat jars, which I believe could simplify the process. If I could produce a fat jar, it would mitigate much of the complexity—like managing dependencies for 83 separate jars—and allow me to avoid reimplementing scala_image just to make this work.
Currently, I’ve written a reimplementation of scala_image that generates two tar files:
- One with the anorexic jar from scala_binary.
- Another with a reduced set of 27 jars that were explicitly declared in the deps parameter of the anorexic JAR.
However, I suspect the remaining 66 jars are transitive dependencies of those 27, which means I'll need to recursively trace dependencies until I’ve accounted for everything. This feels like a daunting task and makes me wonder if there's a more efficient approach.
I’d really appreciate any guidance, suggestions, or examples for addressing this issue. Is there a better way to handle fat jar creation or dependency resolution in this context? Has anyone tackled something similar when using rules_oci with Scala?
Thanks in advance for any help!