sbt-native-packager icon indicating copy to clipboard operation
sbt-native-packager copied to clipboard

GraalVMNativeImagePlugin build in docker container should relabel volume mount for target directory

Open esamson opened this issue 1 year ago • 0 comments

Expected behaviour

Following Docker Image Build Settings, sbt 'show GraalVMNativeImage/packageBin' should work on systems with SELinux enabled.

Actual behaviour

Error: Main entry point class 'foo.bar.Main' neither found on the classpath nor on the modulepath.

Suggestion

Adding the :Z suffix would allow this to work as expected. I think this behaves as a no-op for non-SELinux systems, but we could also make this a configurable setting (or detect the correct default somehow) to be safe.

Information

  • What sbt-native-packager are you using: 1.10.0
  • What sbt version: 1.10.0
  • What is your build system (e.g. Ubuntu, MacOS, Windows, Debian ): Fedora 40
  • What package are you building (e.g. docker, rpm, ...): native image
  • What version has your build tool (find out with e.g. rpm --version): graalVMNativeImageGraalVersion := Some("22")
  • What is your target system (e.g. Ubuntu 16.04, CentOS 7): Fedora 40

esamson avatar Jun 17 '24 13:06 esamson