An image layer is a separate, immutable filesystem change produced by an image-build step and stored as part of a container image. Docker typically creates one layer per Dockerfile instruction, allowing unchanged steps to be reused from cache. section 13.3.1
Use layers deliberately when structuring a Dockerfile:
- Split large build operations into smaller steps so more work can be cached. section 13.3.1
- Copy a project file and run dotnet restore before copying source files; unchanged project files preserve the restored-package layer. section 13.3.1
- Use a multi-stage Dockerfile to publish with the SDK image and copy only the published output into the runtime image. section 13.3.1
Inspect the image's Layers section to see the separate build results retained in the container image. section 13.3.1




