Skip to content

docs: replace misleading Compose lifecycle hook examples#24866

Open
lacatoire wants to merge 2 commits intodocker:mainfrom
lacatoire:docs/24853-compose-lifecycle-examples
Open

docs: replace misleading Compose lifecycle hook examples#24866
lacatoire wants to merge 2 commits intodocker:mainfrom
lacatoire:docs/24853-compose-lifecycle-examples

Conversation

@lacatoire
Copy link
Copy Markdown
Contributor

The post_start example (chowning a volume so the app can use it) and the pre_stop example (flushing caches) don't survive a careful read: the post_start hook runs in parallel with the entrypoint so it cannot reliably prepare the filesystem before the app reads it, and pre_stop doesn't run on abrupt termination so it's the wrong place to flush state the application should already flush on a graceful stop.

Replace both examples with cases that match the documented hook semantics (external registration on start, external de-registration on stop), and add a short caveat explaining why the previous patterns were wrong to attempt.

Fixes #24853

@lacatoire lacatoire requested a review from aevesdocker as a code owner April 23, 2026 08:55
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 23, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 7c72b94
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/69e9e0a5a9266a000856ecd6
😎 Deploy Preview https://deploy-preview-24866--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix examples for Compose lifecycle hooks

1 participant