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

dockerBuildInit doesn't work

Open JMdoubleU opened this issue 2 years ago • 1 comments

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.

JMdoubleU avatar May 07 '23 17:05 JMdoubleU

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

dwickern avatar May 08 '23 02:05 dwickern