Docker is a software to help you manage a system installation on a server. By using a “Container” concept, it can reduce errors when you want your system developed on the development server to be installed on the production server.
Before explaining Docker in details, let’s see what is the “Container” first. Container is a type of software management. It is similar to traditional virtual machines (VM) but VM is quite large because one VM is composed of OS, libraries and services that need to be installed in order to make use of the full potential of the OS. The container, on the other hand, has eliminated all parts unnecessary for the application and left only the OS and the services which are required to run the application. That’s why a container is very small compared with a VM.
Components of Docker
Docker is composed of 4 components as follows:
1. Docker client and server
Docker client: It is where developers write commands to use Docker and send the commands to run on Docker server via Rest API.
Docker server (also known as Docker Host): It is where developers use to build and run the Docker container according to the command received from Docker client. Then it will read the data in Docker image and show the result as an application, so users can use it.
2. Docker image
Docker image is a file storing a command to run Docker container. It is composed of a set of command for application and environment installation, for example, a command to specify data storing conditions of the container. A set of command in Docker image is created by Yet Another Markup Language (YAML).
3. Docker registry
Docker registry (also known as Docker Hub) is for developers to upload Docker images of their developed applications to keep on a center server and share with other developers, so they can download Docker images they want and use on Docker server.
4. Docker container
Docker container is the built application and environment. It runs by the commands specified in Docker image.
Advantages of Docker
- It is small and needs less CPU, RAM compared to VM, so it can save more server resources.
- Docker can be installed easily.
- By using Docker image, it can reduce differences and errors of the installation on development environment and production environment.
- Docker can run on many OS such as Windows, Linux and Mac.
- Docker is quite popular and widely used by developers, so it has a large community. When you encounter any problems using Docker, you can easily find information in the community and solve your problems.
Disadvantages of Docker
- It needs a quite high learning curve because you have to learn how to use many commands to manage Docker. Moreover, the installation commands of each application also vary.
- Data archiving in Docker is complicated. You should not keep the important data in the container because when the container is closed, the data inside the container will be lost. Thus, you should configure it to save the important data externally.
Using Docker for system installation needs a high learning curve at the beginning but once you can use Docker, it can help you build an installation standard, reduce errors which may occur during moving the system from development environment to production environment, and save costs and resources of the server.
Sources: