Is there anything like this for MySQL?
Configure the container without any attached volumes, so that the data is stored in the container itself.
Run your setup scripts, and get the database the way you want it.
Now commit the changes to the container, to create a new container.
Now you can spin up the new container, and your setup data will be already loaded within it.
It's not a big loss when managing production databases in practice because with large tables you roll forward, but it would be nice for dev/qa environments.
https://dev.mysql.com/doc/refman/8.0/en/cannot-roll-back.htm...
Source: DBA.