Skip to content

Command Palette

Search for a command to run...

6 min read
How Docker Really Works: Images, Layers & Containers

How Docker Really Works: Images, Layers & Containers

DockerDevOpsContainers

Docker exists because the environment your code runs in isn't part of your code. Your laptop, CI, and production drift apart silently until something breaks. Containers fix this by packaging the app and its environment together — and unlike virtual machines, they share the host kernel and use Linux namespaces and cgroups for isolation instead of booting a second OS.

An image is a read-only stack of layers built by docker build. A container is a running instance that adds a thin writable copy-on-write layer on top. Every Dockerfile instruction creates a cached layer, so instruction order matters enormously — copying package.json and running npm install before copying source code keeps dependency installs out of your rebuild path. Layers are also additive, which is why deleting a file later doesn't shrink the image and why secrets baked into a layer stay there permanently.

Understanding layers, volumes, and user-defined networks is the difference between 15-second builds and 4-minute ones, and between data that persists and data you lose on docker rm.

Read full article on dev.to

How Nginx Handles Thousands of Connections With One Thread

BackendDevOpsWeb Infrastructure
Published on
Reading time
6 min read

How Git Works Internally: Objects, Branches & the .git Directory

GitDeveloper ToolsBehind the Scenes
Published on
Reading time
6 min read

Enhance Your macOS Terminal with Oh My Zsh, Autosuggestions, and Powerlevel10k

macOSTerminalProductivity
Published on
Reading time
6 min read