I'm new to docker. Been reading some but still don't get it much. Basically if I mount a volume it will be persistent on my hard drive so that my container service can write down and save datas. Seen a lot of container services that is mounted with volumes, like jenkins. But If I have mariadb, do I need to mount a volume to it? What happens if I stop and start the mariadb container?
If you just stop and start the data will not be lost.
All data will be deleted when you delete and recreate the container.
Answering your question. It is not strictly necessary to mount a volume for a persistent service (e.g: database). But it is a recommended practice, it will ease scenarios like changing the container (upgrading).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With