-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DockerPlugin doesn't work with multiple main classes by default #1491
Comments
Thanks for your patience. This is hitting more and more users now. Would you like to open a PR to fix this? The
and without any scoping used here sbt-native-packager/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala Line 129 in 2268343
An option would be to keep this a docker thing. And add Docker / executableScriptName := normalizedName.value
dockerEntrypoint := Seq(s"${(defaultLinuxInstallLocation in Docker).value}/bin/${(Docker / executableScriptName).value}"), and remove the sbt-native-packager/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala Line 281 in 2268343
|
I'll see when I have the time to dig into it and properly test the outcome, but if someone wants to pick it up earlier feel free to do so! |
@kubukoz I was able to work on this 😄 Release is out |
thanks, I'm not getting a lot of time with SNP these days :) |
me neither 😓 |
Expected behaviour
sbt Docker/publishLocal
produces a runnable image or fails at build time in the presence of multiple main classesActual behaviour
The image fails startup
Information
Reproduction
sbt Docker/publishLocal
Try to run the generated image:
Docker/dockerEntrypoint
points to/opt/docker/bin/root
, and setting it to a specific binary helps. Clearly the names are set by a heuristic documented in the docs.However, I don't think the Docker plugin's behavior is intuitive, because if you add a new main class to a working build you'll suddenly be unable to run the images.
Maybe
Docker/stage
should fail if there are many main classes and none of them is explicitly chosen (byDocker/mainClass
ordockerEntrypoint
, I'm not sure)?The text was updated successfully, but these errors were encountered: