Its been 2 days that i have started learning docker here is my question.
when i run docker run ubuntu , it will pull the image and run it.
so basically to run any process or task in the container we have to run the image directly?
so dont we have an option to create the container first and then add image there.
what if we need to do that ? can you clarify me if running image itself makes its own container?
Hi @Akshata-Mathapati
Here’s how it works.
-
Images: These are templates that contain all the dependencies and applications needed to run a service. You define an image by writing a Dockerfile, which lists all the necessary components.
-
Containers: These are instances of images. When you run an image, Docker creates a container from it. The container executes the application defined within the image.
Think of it like a blueprint (image) and a house (container). You can build many houses (containers) from the same blueprint (image).
1 Like
ohk i understand now, thank you soo much Santosh.