What is the difference between a Docker image and a container

0 votes

I have an image for my PostgreSQL instance and an image for my web application, changes to which keep on being persisted.

What is a container and what is the difference between docker image and container?

Can anyone explain it to me?

Thanks.

Sep 4, 2018 in Docker by shubham
• 7,340 points
6,671 views

3 answers to this question.

+1 vote
Here is very basic explanation for image and container.

 An instance of an image is called a container. You have an image, which is a set of layers as you describe. If you start this image, you have a running container of this image. You can have many running containers of the same image.

You can see all your images with docker images whereas you can see your running containers with docker ps (and you can see all containers with docker ps -a).

So a running instance of an image is a container.

I hope the above explanation will be helpful for you.
answered Sep 4, 2018 by Damon Salvatore
• 5,980 points
0 votes
Docker Images:  

                     *  Read only templates used to create containers.build by you or other docker users. stored in the docker hub or  your local registry

Docker container:

                   * isolated application platform .containers need to run your application based on images
answered Sep 24, 2019 by Rajendra
• 510 points
+1 vote
Images are read-only templates that contain a runtime environment that includes application libraries and applications. Images are used to create containers.

Containers are running instance of image . They are segregated user-space environments for running applications isolated from other applications sharing the same host OS.
answered Aug 10, 2020 by Vishal
• 260 points

Related Questions In Docker

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,279 views
0 votes
1 answer
0 votes
1 answer

What is the process for stopping and restarting a docker container?

If you want to stop a docker ...READ MORE

answered Jul 3, 2019 in Docker by Sirajul
• 59,230 points
9,340 views
+1 vote
1 answer

what is the difference between docker swarm and kubernetes

Both Kubernetes and Docker Swarm are important ...READ MORE

answered Sep 24, 2019 in Docker by Sirajul
• 59,230 points
2,377 views
+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,718 views
+1 vote
2 answers

How do I run a docker image as a container?

You can run an image depends on whether you ...READ MORE

answered Sep 7, 2018 in Docker by Damon Salvatore
• 5,980 points
1,605 views
0 votes
1 answer
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