Do Docker Images Share Layers?
The second image contains all the layers from the first image, plus new layers created by the COPY and RUN instructions, and a read-write container layer. Docker already has all the layers from the first image, so it does not need to pull them again. The two images share any layers they have in common.

Are Docker images layered?

Each layer stores the changes compared to the image it's based on. An image can consist of a single layer (that's often the case when the squash command was used). Each instruction in a Dockerfile results in a layer.

Are Docker images shared between users?

Docker makes it easy to share application images and development environments with your collaborators. It's usually best to push images to a centralized repository that everyone else can pull from. In some scenarios, it may make more sense to export an image to an archive that you distribute manually.
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest