sbt / sbt-native-packager

sbt Native Packager
https://sbt-native-packager.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
1.59k stars 437 forks source link

dockerBuildInit doesn't work #1545

Open JMdoubleU opened 1 year ago

JMdoubleU commented 1 year ago

Expected behavior

dockerBuildInit := true should build an image with tini as the entrypoint

Actual behavior

[error] unknown flag: --init
[error] See 'docker build --help'.
[error] java.lang.RuntimeException: Nonzero exit value: 125
[error]     at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:691)

Information

--init is not and has never been an option for docker build - only docker run.

This is a duplicate of #1505 which was closed without any changes.

dwickern commented 1 year ago

I don't think we can make dockerBuildInit work as designed. There's no way for us to know which init is compatible with the base image.

If there's anything actionable here it would be:

  1. Change the documentation to recommend docker run --init or build-time code similar to https://github.com/sbt/sbt-native-packager/issues/1257#issuecomment-881136279
  2. Deprecate or remove the dockerBuildInit option