Thanks for the information! I've had a look at `man oci-hooks` and its way over my
league with many terms I don't understand.
Regarding the clean up script I was asking about, I did some searching per your suggestion
to wait for the SIGTERM signal, and the closest tool I can find so far is the `trap`
command which seems to do something *if* a given signal is given.
My best guess right now is:
1. Create the clean up script, let's call it `my-cleaner.sh`. This script has at least
one line with the `trap` command waiting for the SIGTERM signal. (is there a way to tell
`trap` to wait for SIGTERM *or* SIGKILL???)
2. In the Dockerfile add a `COPY my-cleaner.sh /my-cleaner.sh` line so that the script is
put into the container during `podman build`.
3. As you know, the container images I'm working with already has `CMD /init` (BTW,
what does `/init` do anyway????), so I guess I'll have to start the script by changing
the `CMD` line this way:
```
CMD /my-cleaner.sh & \
&& /init
```
4. Cross fingers and hope that when I run `podman stop` on the container, the resulting
SIGTERM will be seen by the `trap` command in `my-cleaner.sh` and take the clean up steps.
(by the way, how can I check that the clean up actually happened? is there a canonical way
to document if the desired actions were taken?)
Does the above look right?