vert-x3 / vertx-stack

Vert.x stack
Apache License 2.0
120 stars 48 forks source link

stack-docker: make the JVM get pid 1 to allow graceful shutdown #54

Closed tsegismont closed 8 years ago

tsegismont commented 8 years ago

The "sh -c" entry point is nice to work around the Docker var replacement limitation in CMD statements. However the shell keeps running along with the JVM and the shell gets pid 1. Consequently, when you run docker stop, the shell process gets the SIGTERM signal, but does not forward it to the JVM. This means Vert.x does not shutdown gracefully.

exec allows the JVM process to replace the shell.

tsegismont commented 8 years ago

@cescoffier can you have a look? If you're fine with the fix I'll update the vert.x examples repo after this one merge.

cescoffier commented 8 years ago

Is 'exec' available on alpine ?

cescoffier commented 8 years ago

Actually the the tests have passed, it means yes :-)

tsegismont commented 8 years ago

Which automated test? I only tried manually TBH :confused:

Exec is a ash/bash builtin. So yes it can be used on Alpine, even without bash installed.

cescoffier commented 8 years ago

automated tests as in "mvn clean install" ;-)

It's quite new, but I've added a couple of tests, just because, well, you know.... So, if the 'mvn clean install' has passed 👍