Sobes.tech
Middle

Tell me about Docker: what is the difference between an image and a container? What are layers?

sobes.tech AI

Answer from AI

A Docker image is a template containing all the necessary files, libraries, and configurations to run an application. It is static and immutable.

A container is a running instance of an image, an isolated environment where the application operates. A container can change during runtime, but these changes do not affect the original image.

Layers are separate levels that make up an image. Each layer represents changes relative to the previous one (for example, installing a package or copying files). Layers allow efficient use of disk space and caching, as common layers between images are not duplicated.