18 ms·
I recommend using a data volume container: $ docker run --name db-data -v /var/lib/db busybox true $ docker run --name db-server --volumes-from db-data
by discordianfish 12y ago
I recommend using a data volume container:
$ docker run --name db-data -v /var/lib/db busybox true
$ docker run --name db-server --volumes-from db-data db-image
This way you can remove the db-server container and recreated it with the same command and it will reuse the volume. See also https://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container https://docs.docker.com/userguide/dockervolumes/#creating-an...