Docker
/Beginner
What is a Docker Image?
Definition
A read-only, immutable template that contains a set of instructions for creating a Docker container. It includes the application code, libraries, tools, dependencies, and files needed to run the app.
Explain Like I'm New
A snapshot of a computer hard drive. Once an Image is created, it cannot be changed (immutable). It is the perfect, frozen blueprint used to stamp out live Containers.
Real World Example
You download the `postgres:15` Image from the internet. It is a 300MB file. You cannot edit the file. But you can use it to spin up 50 separate, running PostgreSQL databases (Containers).
Common Use Cases
- •Software distribution
- •Version control
Interview Questions
basic
- Can you edit a file permanently inside a Docker Image after it has been built?
intermediate
- What is the relationship between an Image and a Container?