Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: exec the java entrypoint in ash-template #850

Merged
merged 1 commit into from Jul 22, 2016

Conversation

yfyf
Copy link
Contributor

@yfyf yfyf commented Jul 21, 2016

The bash-template correctly correctly wraps the java entrypoint in exec:

execRunner "$java_cmd" \
${java_opts[@]} \
"${java_args[@]}" \
-cp "$(fix_classpath "$app_classpath")" \
"${mainclass[@]}" \
"${app_commands[@]}" \
"${residual_args[@]}"

however here it was missing.

This causes issues when using Docker, because exit signals are not
passed onto the java process, so e.g. Ctrl-C doesn't stop
the running application.

See here for details on why this is needed in Docker:
https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example

The bash-template correctly correctly wraps the `java` entrypoint in `exec`:

https://github.com/sbt/sbt-native-packager/blob/73cc27a920b8162fa55dafc4897acd160707837e/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template#L249-L255
https://github.com/sbt/sbt-native-packager/blob/73cc27a920b8162fa55dafc4897acd160707837e/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template#L136

however here it was missing.

This causes issues when using Docker, because exit signals are not
passed onto the java process, so e.g. Ctrl-C doesn't stop
the running application.

See here for details on why this is needed in Docker:
https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example
@lightbend-cla-validator

Hi @yfyf,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Typesafe Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@muuki88 muuki88 added the docker label Jul 22, 2016
@muuki88 muuki88 merged commit b052830 into sbt:master Jul 22, 2016
@muuki88
Copy link
Contributor

muuki88 commented Jul 22, 2016

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants