Difference between image and container - Containerization cencepts

+6 votes
I'm a beginner with containerization concepts, I'm very confused with what is an image and what is a container and how are apps or websites deployed using these.

Can somebody explain?
Sep 12, 2018 in Docker by lina
• 8,220 points
1,270 views

3 answers to this question.

+4 votes
Entire concept of docker and Kubernetes is containerization, hence it's very important to understand the basic concept of docker images and containers.

Image is the base on which you instantiate containers. Now what is image and container?

Images basically contain softwares like operating systems, MySQL, notepad, etc. and data sets like .java, .class etc.

Imagine containers to be boxes inside which images run. Suppose yo have an image, lets say jdk, when this image is made to run inside a conatiner, it can run java codes without having to install jdk on your system.

So basically containers contain the binary grouping of all the binaries and dependencies that your app requires to give a succesful output.

Images never start by themselves they, only start when run inside a container.
answered Sep 12, 2018 by Kalgi
• 52,350 points
+3 votes
Talking in programming terms or oops terminology,

images are classes or templates.

and containers are instances of a class i.e. it's an object.
answered Sep 12, 2018 by Hannah
• 18,520 points
+2 votes

Pretty simple @lina. Images and Containers are the same, barring one difference. 

Think of it this way, Images are inert (inactive) volumes containing everything your application needs to run. Containers however are the active version of images which actually hosts your application. 

Images and Containers work like Car and Fuel.
Without their compatriot/ partner, they are useless. And when they are working together, we are happy for what is being produced.

In other words, Images are the templates with all the data about the app. When the image is executed, a Container is created which actually contains that app.

For a better understanding of how this works, watch this video of mine. I've explained it as clearly as possible with diagrams, demo, etc: https://www.youtube.com/watch?v=h0NCZbHjIpY

answered Sep 12, 2018 by Vardhan
• 13,150 points

Related Questions In Docker

0 votes
3 answers

What is the difference between a Docker image and a container?

Images are read-only templates that contain a ...READ MORE

answered Aug 10, 2020 in Docker by Vishal
• 260 points
6,716 views
0 votes
1 answer

What is the difference between “expose” and “publish” in Docker?

Basically, you have three options: Neither specify EXPOSE nor -p -> ...READ MORE

answered Jul 18, 2018 in Docker by Nilesh
• 7,060 points
3,306 views
0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,739 views
0 votes
4 answers

what is network namespace and how we can access network namespace for the container?

Hey @Ali, I'll just combine @Eric, @Jackie ...READ MORE

answered Dec 20, 2018 in Docker by Kalgi
• 52,350 points
5,931 views
0 votes
1 answer

How to create a container and run images in docker?

Look for what all images you have ...READ MORE

answered Feb 23, 2019 in Docker by Kalgi
• 52,350 points
2,255 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP