The test for the PostgreSQL container includes a nice function add_cleanup_command that allows to extend the default cleanup action. It would be good to have this function in the test-lib.sh so we can use it in other container images tests as well:
https://github.com/sclorg/postgresql-container/blob/1cbbb075/test/run_test#L48-L58