sbt-native-packager
sbt-native-packager copied to clipboard
dockerBuildInit doesn't work
Expected behaviour
dockerBuildInit := true
should build an image with tini as the entrypoint when I run docker:publishLocal
Actual behaviour
It says that --init
is not an option for docker build
Information
AFAICT --init
is only an argument to docker run
and not docker build
. I don't believe that Docker will install tini on an image for you, it will only run tini for you and use it to fork the container process. Which is not very helpful for sbt-native-packager 😅
Hi @TimWSpence
Thanks for the issue report. I can't recall how this was added, but the contributor who did seems to use it. I'll try to do some archeology and find out what happend back then.
Which docker version are you using?
Many thanks @muuki88! That's very interesting! I've failed to find any reference to docker build
supporting this. I'm not entirely sure how Docker would be able to install it on an arbitrary container? tini is statically linked so I guess it might be possible if it can detect the architecture and kernel version doesn't matter?
I'm running the latest Docker desktop (Docker Desktop 4.7.1 (77678)). Do let me know if I can help in any other way!
https://github.com/krallin/tini
NOTE: If you are using Docker 1.13 or greater, Tini is included in Docker itself. This includes all versions of Docker CE. To enable Tini, just pass the --init flag to docker run.
If you support tini in build there are quite a lot of changes that needs to be made (download the script, chmod, exec)
@muuki88 why was this closed? As far as I can tell --init
has never been an option for docker build
.
You can append it via docker build options
@muuki88
[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)
it is docker run --init
per comment above but it is being documented and coded as buildOption sooo there was a misunderstanding?