Docker Compose Tip #84: Lifecycle hooks now show you why they failed
A failing lifecycle hook, post_start, pre_stop, or the new pre_start, used to report only its exit code: db hook exited with status 1 What the hook actually printed depended on how it ran. Under a plain docker compose up, the output streamed live to the terminal, mixed into the rest of up’s output, but was never carried into the error message itself. Under restart, run, or any tool driving Compose as a library, there was no listener attached at all, so Compose didn’t even request stdout or stderr from the daemon, and there was nothing to read afterward, live or otherwise. Since Compose 5.5.1, both cases keep a tail of the output and fold it straight into the error on failure. ...