- reinstall packages after a runtime update
- restart background services
- recreate temporary runtime state
- restore tools or files your app depends on
Available hooks
Post-image-update hook
Run setup after the runtime image changes.
Post-restart hook
Run setup every time the container starts.
Which hook should you use
- Use
post-image-update.shfor things that should run only after a runtime update - Use
post-restart.shfor things that should run on every start
Tips
- Keep each hook focused on one job
- Test the commands manually in Terminal first
- Keep the script short enough to finish within its timeout