“Understand what Docker is in 5 minutes : Challenged Accepted”

Alan Liew
5 min readFeb 18, 2023

--

Let me explain what is docker and why is it important.

Let’s start with the WHY ?

.
Why Docker ?

You may wondering why Docker gain so much success in such short period of time, and it seem like everyone is talking about docker.

To put in simply, Docker virtualize the virtual machine.

🐳 Docker can virtualize the operating system (OS, eg : ubuntu, debian, centos ) , network, storage and resource allocation(or you can called it control groups).

Next, what is a. container in Docker ?

You can understand containers in Docker as a crazy fast light weight computer, and they have own OS, CPU ,memory and network. They are isolated and safe.

Let me demo it real quick here,

For example, to connect centos OS, we can pull the image from docker using docker pull centos.

docker pull centos                       
You will see centos image are being pull from the docker hub.

then we create a container using this centos image ( this line of command is to create a docker container named “mydocker” that run in detached mode.

docker run -d -t --name mydocker centos
You will see a random string as the response.

Next, let’s us check if the container is being created successfully .

docker ps
As you can see, the centos image is running in mydocker container now.

Now, let’s execute the container and open bash of centos. Boom , now you got it !

As centos is using bash as default command shell.

Voila, you understand how we pull the image (centOS) and then run it in a container now.

To understand the concept better, it’s like you installed centOS into your computer and run it as your operating system.

🐳 Docker is FUN !

First, we pull alpine image from docker hub. Next, we run it in a docker container named “ohyeah”, then we check using docker ps to see if it’s created. Then, we execute the shell of the container (alpine).

Boom ! 🚀, another OS is inside your new container now.

Does it sound easy ? 🐳

Let’s try with the REAL project now.

First, we go to docker hub and copy this command.
In docker , we can pull image:version from docker hub and run.

docker pull thenetworkchuck/nccoffee:frenchpress

Then, we create a docker container and map the port using -p 80:80

docker run -t -d -p 80:80 --name realproject thenetworkchuck/nccoffee:frenchpress 

Now, go to your browser, hit to your localhost with port 80.

localhost:80

Voila, you will be able to see this webpage. 🏆🏆

Important ! ! ! do you realise something ?

Did u setup the website ? or alter any settings ? Do you need to install any program to run this webpage ?

The answer is no, you don’t have to do anything on that.

You just pull the image and run it in a container.

This is because container got its operating system , cpu processes, memory, settings, website configuration, etc etc. And we can move this docker container to aws to azure and it run the same.

The project example that we run just now are in this docker image :

Debian-linux 
NGINX -> website + files
and all the dependencies

The creator can just pack it into a docker image that can run anywhere. What we need to do is to pull the image and run it in a container.

Why is Docker so FAAAASSSTTTT? 🏎️🏎️

First we have to understand the architecture behind it.

The difference of architecture of Virtual Machine and Docker Container.

As you can see here, docker is so fast because we are only using 1 linux kernel compared to VM if we create two VM (in this case).

It is SUPER lightweight ⚡️⚡️⚡️

And due to the different linux kernel in VM , there are different guest operating system + hypervisor, which caused the VM to be very heavy.

Where in the case of Docker, everything is run and created by 1 docker engine. This caused docker to be super lightweight.

The ultimate benefit of using Docker

No matter you as a developer / tester, we can write and deploy it to a docker container, and we know it can run everywhere because everything the app needs will be in the docker container.

And docker container is isolated, where you can just install and update the needed part.

This solves the issue where the “code” works miracely in dev’s machine, and it’s unable to run on other machine.
With Docker, we know this will not happen anymore ! hoorayyy!

More to go ? Subscribe to my medium , where I will share Docker Networking in the next !

❤️

Related Articles:

  1. Cloud Computing , let’s talk about it [Part 2]
  2. AWS ! the terms you must know 🤫
  3. ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?
  4. Why software testing is needed in the first place ?
  5. What is Agile Methodology ?
  6. Java 101 for software testing (Using fruits and Vehicle as example)
  7. What do you need to know to test using Selenium in Java? (that I wished somebody had told me)

❤️

or connect with me in LinkedIn to discuss more !

#Softwaretesting #softwaretestere #SDLC #STLC #ISTQB #Java101 #SeleniumJava #docker #dockercontainer #dockerimage #docker101

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Alan Liew
Alan Liew

Written by Alan Liew

I eat, drink and talk about software testing.. "No Bugs is allowed"

No responses yet

Write a response