Why does my container not contain DB data after I commit it?

As per the comments under the main thread the solution was similar to the one suggested in this existing answer. It boils down to the data directory being a volume and hence living outside of the context of the container being modified/committed.