Introduction to Docker— Part 1

Hardeep Kaur
2 min readNov 13, 2022

--

Hello Readers. I’ve recently started learning Docker, so wanted to share a few key points from my notes.

Before starting, I highly recommend you dig into its official documentation, as it almost covers everything in detail.

Docker is an open platform for developing, shipping, and running applications in an isolated platform. In simple words, With Docker, you can easily package your application with everything you need to run (from packages, dependencies, configurations, binaries, scripts, etc.)

Not only this, you can run it anywhere on any machine with docker.

How is it possible?

The answer is Containers. Containers provide an isolated environment on the host machine which contains everything, that is needed to run the application. For example, if your application needs node v14, mongo 4, and application code to run, then you can have your container with all these setups, and can easily run it, and share it with your team members without any extra effort on the setup.

Container for your application.

Containers are different from VM, as Each VM needs a full-blown OS, and they are slow to start. But unlike VM, Containers start quickly and are extremely lightweight, which use the OS of the host itself. Each Container shares the kernel of the host. (Kernel is the core of the OS which manages apps and hardware resources)

So, if you have your Linux OS, you can only run Linux containers. Similarly, Windows OS can run Windows as well as Linux containers, as recent Windows is shipped with custom-built Linux kernels.

As for Mac, it uses a lightweight Linux VM to run Linux containers.

Containerize an application

In order to build a containerized application, one must need a dockerfile, which is a simple text file without any file extension that contains a script of instructions that docker uses to create an image.

docker image is an executable file that ultimately runs your application.

--

--