> Markdown version of [/videos/100114-docker-build-without-docker](https://www.wearedevelopers.com/videos/100114-docker-build-without-docker). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Docker build without Docker Deleting a file during a Docker build doesn't actually remove it from the archive. Uncover the true mechanics of container layers to master image optimization. - **Speakers:** [Oliver Seitz](https://www.wearedevelopers.com/@oliver-seitz) - **Event:** World Congress 2026 Europe - **Published:** July 9, 2026 - **Duration:** 28:40 - **URL:** https://www.wearedevelopers.com/videos/100114-docker-build-without-docker ## Summary Docker images are fundamentally not magic; they are simple tar archives containing JSON metadata and compressed filesystem layers. Reconstructing a Docker image build step-by-step from the terminal—without relying on the Docker daemon—demystifies this process. By manually downloading an Nginx base image from a content-addressed container registry, developers can see exactly how manifests, configurations, and index files link together using cryptographic hashes to form a runnable container environment. Exploring the mechanics of modifying an image exposes the inner workings of Linux filesystems and container layer caching. Because base layers are immutable to maximize cache efficiency, adding a new file requires compressing it into an independent tar layer and meticulously updating the SHA hashes within the JSON configuration. More crucially, deleting a file during a build does not remove it from the underlying archive. Instead, the runtime creates a "whiteout" file—a specific character device in the OverlayFS copy-on-write system—that merely hides the original file from the final merged directory. This low-level deep dive firmly establishes why leftover build artifacts bloat final architectures and underscores the absolute necessity of multi-stage builds. Standard Dockerfile instructions like COPY or RUN simply automate the process of spinning up a temporary container, capturing upper-layer filesystem diffs, and repackaging them. Ultimately, understanding these underlying Linux primitives transforms how engineering teams approach cache optimization, image size reduction, and overall container performance. **Keywords:** docker image internals, content-addressed storage, overlayfs, container layer caching, whiteout files, multi-stage builds, tar archives, JSON manifests, linux primitives, filesystem diffs, copy-on-write, daemonless builds, image size optimization, container registries ## Chapters 1. **Anatomy of a Docker image and content addressing** (00:27) — How Docker images use tar archives, JSON metadata, and hashes to structure layers in a registry. 1. **Querying a container registry and extracting image layers** (04:06) — Downloading the Alpine image manifest and manually uncompressing its filesystem layer using curl and tar. 1. **Constructing a new Docker layer from scratch** (08:30) — Manually creating a new compressed layer, recomputing hashes, and updating JSON configuration to extend an Nginx image. 1. **Managing deleted files and container layer cache bloat** (15:59) — Why deleting large files in a subsequent layer does not reclaim space due to whiteout file markers. 1. **Understanding Linux OverlayFS mechanics for container filesystems** (19:30) — Demystifying copy-on-write functionality using lower, upper, and merged directories alongside character devices. 1. **Translating Dockerfile instructions into OverlayFS layer snapshots** (25:04) — How the build daemon executes instructions by mutating the upper directory and zipping intermediate states. 1. **Summary and access to demonless build examples** (27:25) — Repository access for the manual image construction scripts and final thoughts on container internals. ## Related Moments - [Docker official best practices for container image architecture](https://www.wearedevelopers.com/videos/109-a-practical-guide-to-writing-secure-dockerfiles) (from "A practical guide to writing secure Dockerfiles") - [Managing ephemeral system layers in Docker containers](https://www.wearedevelopers.com/videos/145-database-devops-with-containers) (from "Database DevOps with Containers") - [Demystifying the mechanics behind container execution routines](https://www.wearedevelopers.com/videos/1094-docker-exec-without-docker) (from "Docker exec without Docker") - [Building and optimizing Docker images using Spring Boot layers](https://www.wearedevelopers.com/videos/242-microservices-how-to-get-started-with-spring-boot-and-kubernetes) (from "Microservices: how to get started with Spring Boot and Kubernetes") - [Optimizing image builds using buildpacks and native images](https://www.wearedevelopers.com/videos/1514-what-s-new-with-spring-boot-and-containers) (from "What's (new) with Spring Boot and Containers?") - [Optimizing container images using multi-step build processes](https://www.wearedevelopers.com/videos/107-reusing-apps-between-teams-and-environments-through-containers) (from "Reusing apps between teams and environments through Containers") ## Related Articles - [Building AI Solutions with Rust and Docker](https://www.wearedevelopers.com/magazine/494-building-ai-solutions-with-rust-and-docker) - [Dev Digest 100 - new look and more content](https://www.wearedevelopers.com/magazine/379-dev-digest-100-new-look-and-more-content) - [Dev Digest 103 - Superb Owl Trafficking](https://www.wearedevelopers.com/magazine/388-dev-digest-103-superb-owl-trafficking) - [Dev Digest 127 - putting 5 rings on it](https://www.wearedevelopers.com/magazine/464-dev-digest-127-putting-5-rings-on-it) ## Related Jobs - [Cloud Foundations Team](https://www.wearedevelopers.com/jobs/ext/1483289-cloud-foundations-team) at **GitHub** - [Platform Engineer (DevOps)](https://www.wearedevelopers.com/jobs/48264-platform-engineer-devops) at **WDW Consulting GmbH** - [IT System Administrator](https://www.wearedevelopers.com/jobs/48290-it-system-administrator) at **Sensory-Minds GmbH** - [Developer Embedded Linux](https://www.wearedevelopers.com/jobs/ext/381560-developer-embedded-linux) at **ZEISS Group** - [Developer Embedded Linux](https://www.wearedevelopers.com/jobs/ext/1543045-developer-embedded-linux) at **ZEISS Group** - [Devops Engineer](https://www.wearedevelopers.com/jobs/ext/1940926-devops-engineer) at **Bitpanda**