trap 'kill $(jobs -p)' EXIT
See https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zomb..., section "A simple init system".