Docker is a Linux Container Engine and uses something called the AUFS – AnotherUnion File System.It is built solely for the purpose of sharing most of the OS resources which are critical and layers the changes needed for a backend service packaged as its own Docker Image. What this means is that you can have multiple docker content/images each running independantly on its own, relying on core OS utils and its dependencies are managed within its Docker container. Further, a docker image can be thought of as a git repository with a series of commits that can build and run, thereby making it easy to deploy changes and manage continous integration.
Docker is still rough in the edges but I decided to run an elasticsearch server and a redis instance in production.
Things get tricky because you don’t have direct access to the docker image file system. Therefore, during run, you should share a mount folder where you can put a service’s configuration,data and logs. As per my convention, I have a DigitalOcean host directory /data/redis and /data/elasticsearch where I store each of the configuration,data and logs. That makes me backup data, change configuration( passwords, etc) and rerun the instance and clear logs with logrotate.
Thanks to Arcus-IO
Further, the above content/images are public. For production you’ll need to bind public ports, have other custom config and not completely rely on docker run to pass time run time environment variables. I am not sure if this is a full blown problem to solve but StackMachine came to the rescue – to be able to push and pull private docker content/images. The only thing I need to do in production is
docker pull stackmachine.com/rep docker run stackmachine.com/rep &
There are tons of interesting content/images at Docker-Index and I am pretty excited to see what this becomes in a few months time.
- This is a highly brief post about the docker ecosystem in general. I am writing individual posts on configuring services like logstash, elasticsearch, redis in detail at a later point in time.