Docker
Containers in practice — images, volumes, Compose, resource limits, and hardening them for multi-tenant use.
33 posts
What Is Kubernetes? A Beginner's Explanation Without the Jargon
Kubernetes is a system for running containers across many machines: it starts them, restarts them when they crash, spreads them across servers, and rolls out new versions. What it actually does, the key terms (pods, nodes, deployments), and why most small apps don't need it.
How to Self-Host n8n: Docker, Postgres, HTTPS and Backups
A production-minded guide to self-hosting n8n: Docker Compose with Postgres instead of SQLite, the environment variables that matter (encryption key, webhook URL, timezone), HTTPS behind a reverse proxy, backups of both the database and the encryption key, updates, and when queue mode is worth it.
SBOMs and Signed Images: Software Supply Chain Security With Syft and Cosign
How to know what's in your container images and prove they came from your CI: generating SBOMs with Syft or BuildKit attestations, scanning them for vulnerabilities, signing images keylessly with Cosign and GitHub Actions OIDC, verifying by identity, adding SLSA provenance, and enforcing it at deploy time.
.dockerignore Explained: Faster Builds, Smaller Images, No Leaked Secrets
A .dockerignore file keeps files out of the Docker build context: node_modules, .git, .env files, build output. Why that makes builds faster and images smaller, how it prevents secrets ending up in images, the syntax and negation rules, a ready-to-use template, and how to check what's being sent.
Docker Compose Healthchecks and depends_on: Start Services in the Right Order
depends_on alone only waits for a container to start, not for it to be ready — which is why your app crashes with ECONNREFUSED while Postgres boots. How to write healthchecks for Postgres, MySQL, Redis and your own app, use condition: service_healthy, tune intervals, and debug unhealthy containers.
Docker Launches Cloud Sandboxes for AI Agents — and Open Kits on OCI
On 24 September 2026 Docker launched Cloud Sandboxes, extending its local agent sandboxes to Docker-managed cloud infrastructure with the same microVM isolation, policies and CLI, boot times in the low hundreds of milliseconds and 1–16 vCPUs. It also published next-generation Kits, an OCI-based spec for packaging an agent, its tools and its access rules.
runc and OCI Runtimes: What Actually Starts Your Container
Below Docker and containerd sits a small program that creates the namespaces, cgroups and mounts and execs your process: the OCI runtime. The OCI image, runtime and distribution specs, a bundle and config.json, running runc by hand, alternatives (crun, youki, gVisor's runsc, Kata), and runc's notable escapes.
PID 1 in Containers: Signals, Zombies, and Why Your Container Won't Stop
Inside a container your app is PID 1, and PID 1 is special: the kernel won't apply default signal handlers to it and it must reap orphaned children. Why docker stop takes 10 seconds, why shell-form CMD swallows SIGTERM, zombies, and the fixes: exec form, tini/--init, signal handling.
"exec format error" in Docker: ARM vs x86 Images Explained
exec format error almost always means a container image built for one CPU architecture (ARM, like Apple Silicon Macs) is running on another (x86/amd64 servers), or vice versa. How to check, build for the right platform with --platform and buildx, and the other cause: scripts without a shebang or with Windows line endings.
Dockerfile Explained: Every Line of a Simple Dockerfile
A Dockerfile is the recipe Docker follows to build an image. A line-by-line walkthrough of a real Dockerfile — FROM, WORKDIR, COPY, RUN, ENV, EXPOSE, CMD — why the order matters for caching, .dockerignore, and the beginner mistakes that make images slow, huge or insecure.
Docker vs Docker Compose: What's the Difference?
Docker runs individual containers; Docker Compose describes and runs a group of containers that work together — your app, its database and a cache — from one YAML file. How they relate, the same setup with and without Compose, and the commands you'll use.
Docker "Port Is Already Allocated": How to Find and Free the Port
Docker can't publish a container's port because something on your machine already uses it — often another container, a local Postgres or a dev server. How to find what's using the port on Mac, Linux and Windows, stop it, or simply map the container to a different port.
Docker "Permission Denied While Trying to Connect to the Docker Daemon Socket": Fix
Your user isn't allowed to talk to Docker's socket at /var/run/docker.sock. The quick fix (add yourself to the docker group), why that's effectively root access, the safer rootless alternative, and the other causes: Docker not running, Docker Desktop, WSL and CI.
Docker Image vs Container: What's the Difference?
An image is a read-only template; a container is a running instance of it. The difference explained with analogies and commands, what happens to files when a container is removed, why data belongs in volumes, and how tags, registries and layers fit in.
Docker Image Layers and OverlayFS: How Container Filesystems Really Work
A Docker image is a stack of read-only layers merged by OverlayFS, with a thin writable layer per container. How layers are built and cached, content addressing and digests, copy-up and whiteouts, why deleting files doesn't shrink images, and the performance traps for databases.
Docker Container Keeps Restarting: How to Find Out Why
A container stuck in 'Restarting' is crashing on start and being brought back by its restart policy. How to read exit codes (1, 126, 127, 137, 139, 143), get logs from a crash loop, override the entrypoint to look inside, and fix the usual causes: config errors, OOM kills, missing dependencies and failing healthchecks.
Docker Compose Networking: How Containers Talk to Each Other
How services in a Compose project find each other by name, why localhost doesn't work between containers, ports vs expose, custom and external networks, reaching the host from a container, connecting two Compose projects, and the security gotcha of published ports.
Docker Commands Cheat Sheet: The 40 You'll Actually Use
A practical Docker cheat sheet: running and stopping containers, viewing logs, getting a shell inside, building and tagging images, volumes, networks, Docker Compose, and cleaning up disk space — with what each command does in plain English.
containerd vs Docker: How the Container Stack Fits Together
Docker Engine is built on containerd, which is built on runc — and Kubernetes now talks to containerd or CRI-O directly. What each layer does, why Kubernetes removed dockershim, namespaces in containerd, nerdctl and ctr, image stores and snapshotters, and which one you actually need.
Running Claude Code in a Dev Container
Put Claude Code inside a dev container so every command it runs happens in an isolated, reproducible environment instead of on your machine. Adding the official Dev Container Feature, persisting login across rebuilds, enforcing policy with managed settings, restricting network egress, and the limits of the protection.
How to Reduce Docker Image Size: From 1.5 GB to Under 200 MB
Big Docker images are slow to build, push, pull and deploy. The techniques that actually shrink them: slim base images, multi-stage builds, .dockerignore, production-only dependencies, layer ordering, cache cleanup — with Node.js and Python examples and a way to see what's taking space.
Do You Need Kubernetes? (Probably Not Yet — Here's How to Tell)
Kubernetes runs containers across many machines and is everywhere in job ads. What it actually does, what it costs to operate, the signs you might need it, and the simpler options that serve almost every small app and startup better.
What Is Docker? A Beginner's Explanation
Docker packages an app with everything it needs to run, so it works the same on any computer. What containers and images are, how they differ from virtual machines, why hosts and AI tools use them everywhere, and whether you need to learn Docker at all.
What Is a Dev Container? devcontainer.json Explained
A dev container defines your development environment as code — the tools, versions, services, and settings a project needs — so it runs the same on every machine and in the cloud. What goes in devcontainer.json, how it differs from a Dockerfile, and where it falls short.
Rootless Containers and User Namespaces: What They Actually Protect
Root in a container is root on the host unless something remaps it. How user namespaces work, subuid/subgid ranges, Docker userns-remap vs rootless mode vs Podman, Kubernetes hostUsers: false, the file-ownership and networking costs, and where rootless fits.
Writing a Production Dockerfile for a Node.js App
The Dockerfile an AI tool writes usually works — and ships a 1.5 GB image running as root that ignores shutdown signals and leaks build secrets into its layers. A line-by-line production Dockerfile: multi-stage builds, layer caching, non-root users, signal handling, secrets, and health checks.
Docker Volumes vs Bind Mounts: Where Your Data Actually Lives
Containers are meant to be thrown away. Your database, uploads, and certificates are not. The three ways Docker stores data — the container layer, named volumes, and bind mounts — what survives what, the command that silently deletes your database, and how to back a volume up.
Docker Compose for Local Development: App, Postgres, and Redis in One Command
A compose.yaml that starts your whole stack — app, database, cache, and workers — with one command. Services, networking by service name, volumes for data and code, health-checked startup order, env files, profiles, watch mode for live reload, and the pitfalls on macOS and Windows.
Containers vs Virtual Machines: The Difference, Simply Explained
Both let one physical computer act like many. A virtual machine pretends to be a whole computer; a container is an isolated group of processes sharing one operating system. How each works, the trade-offs in speed, size, and isolation, and when to use which.
Container Networking Internals: veth, Bridges, NAT, and Embedded DNS
What happens when a container sends a packet: network namespaces, veth pairs, bridges, NAT for egress and published ports, why published ports bypass firewalls like ufw, Docker's embedded DNS, inter-container isolation, and debugging with nsenter and tcpdump.
Hardening Containers With Capabilities, seccomp, AppArmor, and User Namespaces
A default container shares the host kernel and starts with more privilege than most workloads need. A layer-by-layer guide: dropping capabilities, no-new-privileges, seccomp, AppArmor and SELinux, read-only filesystems, and user namespaces — and how to verify each.
How Container CPU and Memory Limits Actually Work
docker run --cpus 2 --memory 4g looks simple. Underneath, it's cgroup v2 files with behaviour that surprises people: CPU limits that throttle rather than slow, memory limits that count page cache, and tools inside the container that report the host's resources. How to read the real numbers.
Docker vs Linux Users for Multi-Tenant Workspace Isolation
Separate Linux users look like a cheap way to isolate tenants until you try to enforce a CPU limit. A walkthrough of why containers win for multi-tenant development workspaces — and how to verify the limits are real.