In this blog post, the aim is to introduce you to Docker, one of the most exciting and powerful opensource projects that has sprung up in the recent years. In a nutshell, Docker offers you the tools to package everything that forms an application, allowing you to effortlessly deploy the application across systems and machines (both virtual and physical). It allows you to setup once and then deploy anywhere. Docker makes it extremely easy for Consultants, Technical Account Managers, Solutions Architects and others to quickly test a piece of software. It's much quicker to use than a virtual machine, and it requires fewer resources. The average command takes under a second to complete!
So why is every one raving about it? The short answer is that it is so light weight. Furthermore, it allows you to port applications across systems and hardware with ease, all while containing those applications and running them in their own secure sandboxed environments
The whole process of porting applications is based on Docker containers which as just simple
directories that can be copied across to different systems or machines.
Docker reuses mostly existing kernel functionality and Linux libraries, simply glueing the existing tools. It makes use of LXC technology which provides for virtualisation without the overhead of other virtualisation technologies.
Using LXC, it's is able to contain applications limiting resources, not allowing access beyond their own filesystem as well as process isolation.
By using containers, applications are able to work anywhere they are deployed to.
Because it is filesystem based it is easy to take snapshots, perform rollbacks similar to using a version control system
The main parts of the deployment system are:
The above tools are used to create the applications which consist of:
A lot more can be said about this program. To get the full low down, refer to the Docker documentation. To get started with using it on your system, you need to have kernel version 3.12.27 or later, which will be 'Docker'enabled.
The system is supported on the following different distributions:
For Ubuntu 12.04 follow instructions here.
$ apt-get update $ apt-get install docker.io lxc $ ln sf /usr/bin/docker.io /usr/local/bin/docker $ sed i '$acomplete F _docker docker' /etc/bash_completion.d/docker.io
$ yum install docker $ yum install dockerio lxc $ systemctl start docker $ systemctl enable docker
Once you install docker, start your first container, like this.
$ docker run [image name] [command to run]
*note that this is usage syntax, not a command
$ docker run ubuntu /bin/bash
Next up, we will see how to use its command line interface in detail. Stay tuned for the rest of the series!