What is Docker image & Container ???

Niluka Sripali Monnankulama
Many Minds
Published in
3 min readDec 24, 2019

In my last blog, we try to answer the question of “Why use Docker".. And we eventually said that we use Docker because it makes it really easy to install and run new software on our computer.

Now I picked up two important pieces of terminology docker image and container.

So if someone says oh yes, I use Docker in my project, They might be referring Docker client, Docker server, Docker Machine, Docker Hub, Docker Compose…...

Again, these are all project tools pieces of software that come together to form a platform or ecosystem around creating and running something called Containers..

What’s a Container or image? ???

Let me explain with an example,

“A company needs to develop a Java Application. In order to do so, the developer will set up an environment with tomcat server installed in it. Once the application is developed, it needs to be tested by the tester. Now the tester will again set up tomcat environment from scratch to test the application. Once the application testing is done, it will be deployed on the production server. Again the production needs an environment with tomcat installed on it so that it can host the Java application. If you see the same tomcat environment setup is done thrice. There are some issues that I have listed below with this approach:

1) There is a loss of time and effort.

2) There could be a version mismatch in different setups i.e. the developer & tester may have installed tomcat 7, however, the system admin installed tomcat 9 on the production server.

Now, I will show you how Docker container can be used to prevent this loss.

In this case, the developer will create a tomcat docker image ( A Docker Image is nothing but a blueprint to deploy multiple containers of the same configurations ) using a base image like Ubuntu, which is already existing in Docker Hub (Docker Hub has some base docker images available for free). Now this image can be used by the developer, the tester and the system admin to deploy the tomcat environment. This is how Docker container solves the problem.

Further more Docker image is a single file containing all the dependencies and all the configuration required to run a very specific program. This image gets stored on your hard drive and at some point in time, you can use this image to create something called a container.

A container is an instance of an image. And you can kind of think of it as being like a running program. So a container is a program with its own isolated set of hardware resources.

So it kind of has its own little set or its own little space of memory has its own little space of networking technology and its own little space of hard drive space as well.

I hope you are now clear on What is Docker image & Docker Container."

--

--

Niluka Sripali Monnankulama
Many Minds

An IT professional with over 7+ years of experience. Member of the WSO2 Identity & Access Management Team.