Answer the question
In order to leave comments, you need to log in
Running a docker container with data persistence?
Good evening,
You need to run a docker container with the ability to save data after reboot/shutdown/crash.
Having studied this question a little, I found two options.
1. Periodically commit the container (not very willing to do this)
2. Each time you start, mount the volume into which the specified directories from the container will be automatically replicated.
An example of what I'm trying:
docker run --name some_name -v /media/mount_dir:/dockerdir -itd docker.io/centos /bin/bash
Answer the question
In order to leave comments, you need to log in
Are you waiting for something to show up? Create a file there manually and make sure that it is present on the host system:
docker exec some_name touch /dockerdir/test
ls /media/mount_dir/
touch /media/mount_dir/test222
docker exec some_name ls /dockerdir
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question