You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using both the JLink an the Docker plugins, when developing on a Mac machine, I'd like to get a Docker image that would run on a Linux machine on a CPU architecture determined by the JDK base image, from which JLink would cherry-pick the required modules.
Right now docker:publishLocal builds the package locally outside Docker, and then injects the resulting package into the Docker image with the JDK/JRE base image for the target platform. This works fine. And I greatly appreciate it. However, the resulting container image is typically relatively large. I'd like to minimize the target JDK/JRE. This issue had come up already in #1449.
Specifically, running moduleName / docker:publishLocal performs the JLink instructions (with a lot of missing transitive dependencies, but that's a different story that I need to investigate more thoroughly) against the local JDK given by javaHome0 in JlinkPlugin.scala#L52.
I need the JLink plugin to run inside a container against the target JDK prior to the copying stage0.
I imagine there should be a way for cross-compiling with JLink to either
provide the path to another local JDK (which isn't good for replication), or
add a pre-stage to the resulting Dockerfile that would run either
the entire sbt build, or
the JLink plugin
against the target JDK, and then use that stage rather than the baseline image.
At least I can extract the JLink parameter values and pass them on to modified Dockerfile instructions in my build.sbt but this would get all messy with a larger CI configuration and doesn't seem ready for full build automation.
Running the entire sbt workflow inside a container would solve this issue but it would break a lot of tooling and complicate the matters, for example IntelliJ IDEA didn't support it in its 2019 versions.
If there's some simple work-around please point me in the right direction.
Observed and desired behavior
Using both the JLink an the Docker plugins, when developing on a Mac machine, I'd like to get a Docker image that would run on a Linux machine on a CPU architecture determined by the JDK base image, from which JLink would cherry-pick the required modules.
Right now
docker:publishLocal
builds the package locally outside Docker, and then injects the resulting package into the Docker image with the JDK/JRE base image for the target platform. This works fine. And I greatly appreciate it. However, the resulting container image is typically relatively large. I'd like to minimize the target JDK/JRE. This issue had come up already in #1449.Specifically, running
moduleName / docker:publishLocal
performs the JLink instructions (with a lot of missing transitive dependencies, but that's a different story that I need to investigate more thoroughly) against the local JDK given byjavaHome0
inJlinkPlugin.scala#L52
.I need the JLink plugin to run inside a container against the target JDK prior to the copying
stage0
.I imagine there should be a way for cross-compiling with JLink to either
provide the path to another local JDK (which isn't good for replication), or
add a pre-stage to the resulting Dockerfile that would run either
against the target JDK, and then use that stage rather than the baseline image.
At least I can extract the JLink parameter values and pass them on to modified
Dockerfile
instructions in mybuild.sbt
but this would get all messy with a larger CI configuration and doesn't seem ready for full build automation.Running the entire sbt workflow inside a container would solve this issue but it would break a lot of tooling and complicate the matters, for example IntelliJ IDEA didn't support it in its 2019 versions.
If there's some simple work-around please point me in the right direction.
Information
The text was updated successfully, but these errors were encountered: