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
• 6,910 points
4,272 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,550 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
• 480 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 by Vishal
• 220 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
• 6,980 points
1,571 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
• 58,130 points
1,792 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
• 58,130 points
871 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
• 57,700 points
843 views
0 votes
2 answers

How do I run a docker image as a container?

You could probably follow these steps : $ docker ...READ MORE

answered Aug 9, 2019 in Docker by Sirajul
• 58,130 points
362 views
0 votes
1 answer