Understand Docker


If you were following trends in social web about “devops” and “cloud“, you’ve surely heard about Docker. So what’s Docker and why we use it ? In this post, I’ll try to answer this.

Docker

If you are a developer and participated in a big project in which you touch many layers, or you are a sysadmin gay, you have probably heard or said:

But it works on my machine

Yeah, this very recurring. So what’s the promise of Docker ?

Build once, Run anywhere !

What ?

The best way to describe Docker, is to use the official description phrase:

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.

This is means that if you’re a developer, don’t worry about the system in which your application will be running on, and if you’re a sysadmin don’t worry about different troubleshooting in deployment, Docker will create a container with the right version of your application dependencies. Indeed, Docker will help you to build, share and manage your Linux containers.

For more information about Docker:

Why ?

  • Isolation: servers, services, applications, etc.
  • Deployment: improve quality of deployment process.
  • Scalability: scaling is an easy process and straight-forward.
  • Teams: improve collaboration between different teams with different backgrounds: developers, sysadmins, testers & QA
  • Productivity: Bring up a new instance in few minutes
  • Simplification: dependency management, configuration, etc.

How ?

Docker uses a client/server architecture. Below a diagram describing the Docker architecture:

docker-architecture

the Docker client communicates with the daemon via sockets. Users interact with daemon via the Docker client. Inside Docker, we have 3 main terminologies:

  • Docker images: this is a read-only template for a service/application, an image can maintain a Debian OS with PostgreSQL, a Debian OS with Apache and your web application, etc.
  • Docker registries: which is also called Docker Hub, which contain a huge numbers of images: your images and others’ images. You can download a docker image with this command: docker pull <image-name>
  • Docker containers: this is the container of your image which is the run component of Docker. Docker containers can be run, started, stopped, etc.

I hope that you find this post useful. If you find any error or have a suggestion, feel free to comment on. Thanks for reading !

Leave a comment