To catch SIGTERM in Docker, do:

  • Don’t run tail in foreground! Run tail in background and call wait on it.
  • Apparently, wait works but tail does not.