Image
A Docker Image is a read-only template made of stacked read-only layers. Running one produces a Container.
It does not contain a complete operating system. There is no kernel inside — only the application layer files (binaries, libraries, config) plus the instruction of what to run at startup. That is why an image can be as small as 5MB, and why an Ubuntu container and an Alpine container on the same host look completely different: the difference is entirely what each image ships. The kernel is the host’s, and it is shared. → VM 與容器的差別在有沒有自己的 kernel
Images are immutable: changing your code does not update an existing image, nor the containers already running from it. Rebuild, then replace the container.
Related: Image 完整名字是 Registry-Namespace-Repository-Tag、Dockerfile 分層快取由上往下連鎖失效、多階段建置把建置工具擋在最終 image 之外
Ref:
https://philipzheng.gitbook.io/docker_practice/basic_concept/image