You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whether the ``--init`` build option should be passed to the Docker build. See :ref:`Init support` for when this may be useful.
182
+
Defaults to ``false``.
183
+
180
184
``dockerBuildOptions``
181
185
Overrides the default Docker build options.
182
-
Defaults to ``Seq("--force-rm", "-t", "[dockerAlias]")``. This default is expanded if ``dockerUpdateLatest`` is set to true.
186
+
Defaults to ``Seq("--force-rm", "-t", "[dockerAlias]")``. This default is expanded if either ``dockerUpdateLatest`` or ``dockerBuildInit`` is set to true.
183
187
184
188
``dockerExecCommand``
185
189
Overrides the default Docker exec command.
@@ -423,3 +427,23 @@ Just like for :ref:`java-app-plugin`, you have the option of overriding the defa
423
427
your own ``src/templates/ash-template`` file. When overriding the file don't forget to include
424
428
``${{template_declares}}`` somewhere to populate ``$app_classpath $app_mainclass`` from your sbt project.
425
429
You'll likely need these to launch your program.
430
+
431
+
Init support
432
+
~~~~~~~~~~~~
433
+
434
+
By default, Java will run with PID 1 when you run your docker container. The JVM behaves differently when its PID is 1
435
+
compared to other PIDs, most notably, it doesn't respond to some signals. These include the signals usually used to
436
+
instruct a Java process to dump its threads or its heap. If you want to be able to debug a running Java container, the
437
+
inability to take thread or heap dumps can be a problem.
438
+
439
+
Docker has a convenient solution to this, it can configure a separate init process for you. This process will start
440
+
your Java process, and it will also do some other useful things that init processes are meant to do like cleaning up
441
+
orphaned processes in the container. But most importantly it will ensure that your Java process is not PID 1, which
442
+
will in turn ensure that your Java process is able to respond to signals for debugging. The command docker uses is
443
+
`tini <https://github.com/krallin/tini>`_, which as its name suggests, is tiny, only 23kb in size.
444
+
445
+
To tell docker to configure a separate init process using tini, set the `dockerBuildInit` setting to `true`:
0 commit comments