Getting started with Containers — Part-I

PARAB
3 min readJul 20, 2021

--

Basics of Containers

Hello peers 🙋🏻‍♂️🙋🏻‍♂️….

In this article, I will introduce containers to you. This article does not require any previous knowledge. But a little knowledge of Linux would be appreciated…😄😄

What are Containers ? 🤔

If I want to define containers in a line then I would say “Containers are processes running inside an isolated environment”.

For understanding Containers… First we must understand why we need them.

Why?

Let’s take an example of setting up a webserver. Now, for this purpose there can be various ways that can be taken and basically these are advancements in the same technology over a period of time 📅📅

1. Bare Metal -

Earlier, We had to set up our own server by purchasing or renting actual physical hardware and software. Now, we also need to maintain them and if we want to scale our product then we have to purchase more and so on. There is no return if you have purchased it once. This can be very hectic.

For every product we have to setup different hardware as well as OS

2. VMs -

Then VMs came into existence, they allowed us to manage different OS on the single physical hardware. It surpasses some of the issues but still we have to maintain that single hardware and also all OS on different VMs. All the software, updates, upgrades, and …

Multiple OS in single hardware

3. Cloud Services -

Then, we encountered the concept of cloud services. Software as a Service (SaaS), Infrastructure as a Service (IaaS), Platform as a Service (Paas), Storage as a Service (SaaS) and many more are the features of cloud services. Now, we don’t have to pay for bare metal and also we are not responsible for maintaining it. We can just subscribe for any cloud provider of our choice and can take VM according to our performance and storage requirements.👍👍

But….

Even if cloud offers amazing features we are still paying for different operating systems and also we have to do work for maintaining the OS environment for our product. Would it not be nice if we can set up different products on the same OS on the same VM without any interaction in between them….🤔🤔

vCPU (virtual CPU) provided by cloud service providers

4. Containers -

Here comes the role of containers…😎😎

Containers are nothing but an isolated process on the host operating system which are made for doing specific tasks. Containers provide us many security and resource-management features of VMs but also we are not paying for a whole other operating system.

Here we get our answer of why we needed containers.🥂🥂

Containers are best 😎😎😎

How containers do this ``Isolation’’ of process

If you are wondering, how containers are able to isolate process…. Great🙌

Containers achieve this isolation by leveraging three Linux features -

→ chroot

→ namespace

→ cgroup

If you do not know what are these fancy words then, I assure you there is no need for you to know these. Even many people working with containers might not know about these. Because you might not make raw containers by yourself. There are various tools to abstract a complex process to make a ready-to-use container for you.✌✌

Benefits of Containers -

  • Containers are getting secure day-by-day and are adopted by tech industries.
  • Containers are the future of code deployment. Thus, we must understand containers so that we can embrace the power of containerization.
  • Containers are basis of monolith to microservice architecture.
  • Containers reduce cost of maintenance and infrastructure.

Friends, that would be all for this article… 👍👍

Hope you’ve liked it. We will be setting up raw container on our own (without the help of any tool) in the next article.

Till then …🙋🏻‍♂️🙋🏻‍♂

--

--

PARAB

Cybersecurity Enthusiast || AWS || GCP || Full Stack Developer || Docker