What is Docker?
In our setup we are gonna be using Docker to run our applications, so we need to understand what is docker and how is it different to run our applications in Docker.
Docker is a type of widely used containerization tool. Now what is containerization? Lets take an example of nginx application, its a webserver which is widely used.
What is Containerization?
Traditionally we use to install nginx directly on OS via any repository according to your OS (e.g. apt for ubuntu), here the nginx is installed on OS and becomes part of the operating system. However, with containerization, we don't install Nginx directly on the OS. Instead, we create a lightweight and standalone environment called a "container" that has its own file system, processes, and network spaces.
This container is isolated from the host OS, so even if we have multiple containers running different applications, or even multiple containers of same application and they won't interfere with each other or with the host OS. Each container runs in its own separate environment, which is isolated from the host OS or other containers. This makes it easier to manage, additionally also helps us to scale our applications if needed.
Docker and Containerization?
Docker takes this concept of containerization a step further by providing a standardized way to create and run containers. A docker can be considered as a light weight VM (not actually a VM) which contains all necessary files and dependencies to run the application properly. This way we dont need to worry about the dependencies being installed on then host OS as the Docker container will be having everything to run.
With Docker, we can package our application and its dependencies into a single container file, which is called a "docker image." We can then run this image on any system that has Docker installed, without worrying about compatibility issues or dependencies. This makes it easy to develop, test, and deploy applications across different environments, including development, staging, and production.
For most of our homelab we will be using Docker containers for all our applications. The process of installing docker and running docker will be discussed in next articles.
Subscribe to our monthly news letter. Its completely free. You will be sent a newsletter containing our monthly articles. No advertisement what so ever.