Docker : Build, Ship & Run !

Docker : Build, Ship & Run !

Why Docker?

Introduction:

Before introducing Doctor, first, we need to know why we have to develop the docker technology. In the past, when a person wanted to run a single application, it made one server run that application.

But if he wants to run another application, he needs to develop a whole other server because one server can run only one application. That was annoying and inconvenient for that person. So after some years, this problem was solved by Virtual machines (VM).

What are "VMs"?

Virtual machines can run multiple applications on a single server by using operating systems. Now by using a VM, we were able to run multiple applications on a server. But to run the applications, each of them needs their operating system. without an operating system, you can not run that application. VM also became inconvenient

All these problems were solved by Linux-based containers which got famous.

What are "Containers"?

Docker is an open platform for developing, shipping and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.

In simple terms, it's just a collection of everything which is required to run an application. As the name suggests, Containers are those that contain everything that we need to run an application. Now We do not require Operating systems or multiple servers to run multiple applications.

You just need to download the container, it has everything to run that application and it will run that application. isn't it so easy??? You just need to download the container that's it...!

That is Containers and those are used by Docker. Docker will provide us with Those Containers. to use them for our purpose.

Orchestration, engine, and Runtime

Runtime

Runtime is used for controlling Containers. It controls when a container will start or when it will stop. It starts or stops a Container. There are many runtimes, but two of them are important, like runtime c and runtime d.

Runtime c: it works with Operating System. It's a low-level runtime. It starts and stops the container.

Runtime d: it's a high-level runtime that controls runtime c itself. It manages containers. It interacts with the network. Pull data from the Internet.

Engine

Engine Manages Containers. docker runs on top of the engine. it manages containers and works natively on Linux. it has three main components, Docker Daemon, Docker client and Rest API.

Docker: What's Under the Hood?

Docker Daemon

Docker Daemon is nothing but a Container repository where all containers are stored. You can consider it as Server. It provides us with all those containers.

Docker Client

Docker works on client-server architecture. The client request data from the server then the server responds accordingly. Docker clients communicate with daemon by using "Rest API"

Orchestration

Orchestration manages server containers and their versions and everything related to server containers.

Docker file

A Dockerfile is where you write the instructions to build a Docker image. These instructions can be:

  • RUN apt-get y install some-package: to install a software package

  • EXPOSE 8000: to expose a port

  • ENV ANT_HOME /usr/local/apache-ant to pass an environment variable

and so forth. Once you’ve got your Dockerfile set up, you can use the docker build command to build an image from it.

Images:

Container images are a collection of instructions that can generate our application. To containerize applications into Images, first, write a docker file of that application, then use a docker file to generate a docker Image.

History:

Open Containers were initiated by Linux Foundation. And they got famous because they have Runtime specifications and Image specifications.

Free vector cute blue whale cartoon icon illustration.

Why, did Linux based got Famous?

  1. Speed: Docker containers are very lightweight and fast. Since containers are just sandboxed environments running on the kernel, they take up fewer resources. You can create and run a Docker container in seconds, compared to VMs which might take longer because they have to boot up a full virtual operating system every time.

2. Modularity and Scalability: Docker makes it easy to break out your application’s functionality into individual containers

3. Docker Hub: Docker users also benefit from the increasingly rich ecosystem of Docker Hub, which you can think of as an “app store for Docker images.” Docker Hub has tens of thousands of public images created by the community that are readily available for use.

Conclusion:

Isn't that cool? When you want to run an application, you just need to download its image. That's it—no need to download any software. Images provide us with an isolated environment to run the application.

Thanks for Reading!

comment below if you found this helpful...