A Docker container is-a run-time instance of a Docker specification. There is (or may-be) a binary image of that specification in the Docker repository -- IF you have 'saved one'
Our Docker container is like a startup or autoexec script for a Specific system and Specific configuration and Specific data (content). That is GREAT for repeated running of static things like small web sites, evaluating a server or software package, repeatable test-runs, etc. (for example).
To me the first use-case (I might) show people is a "test database". Every time you say:
docker run test-database-server
The / Any application with a connection string pointing to that running Docker image is a database server full of know test data for my app. I can update the data within the container -- These updates will NOT persist once the test-database-server terminates. It is like a database reset. Perfect for testing things.
If I wanted my test-database-server to point at different data contents -- Ergo, I may have two or three different test data-sets -- I can put the data in a different Docker container which I can
use from my test-database-server
docker run test-database-server -volumes-from=test-data-container
And my test-data-container
can even point to or use "real" disk on my system via the -volume=...
option. So the date for test-data-container
can be set-up to be persistent as an actual databases outside the container. As I understand it nothing "inside" a container can persist, it is like pre-initialised RAM. It can change and is reset when the image stops.
links: