G
YouTube TikTok Games
Skip to main content

Docker

Docker articles, tutorials, and guides on DevOps Daily covering containers, images, Dockerfiles, Compose, volumes, networking, and production best practices.

28posts

Guides

Posts

Docker
|16 min read

Docker Build Cache on Ephemeral CI Runners: inline, registry and local, Measured

A fresh CI runner starts with no BuildKit cache. We rebuilt a real multi-stage Node service on a new builder every time, with no cache, inline, registry min and max, and a local cache directory, and measured cold builds, a one-line change, a dependency bump, the export cost and the cache size.

Docker
|10 min read

Docker Desktop Switched New Containers to the local Log Driver. We Measured What That Changes

Docker Desktop 4.94 made local the default log driver for new Linux containers, while Docker Engine on your servers still uses json-file with no rotation. We wrote the same 500,000 lines through both. local kept every line in 24 MB where json-file used 84 MB. A file-tailing collector read none of them.

Docker
|16 min read

Why Your Base Image Has 1,684 CVEs

I inventoried 17 base images straight from the registry and counted every advisory against the exact package versions inside. The totals are larger than you expect, one package produces most of them, and the runtime you actually run is not in the count at all.

Docker
|9 min read

Stop Compiling Postgres Extensions in Your Dockerfile: How pglayers Works

Adding pgvector or PostGIS to a Postgres image usually means apt-get, build tools, and a fat, slow image. pglayers ships each extension as a scratch Docker layer you COPY in. Here is how it works and when to use it.

Docker
|19 min read

How Docker Really Works, From docker run to the Kernel

You type docker run and a container appears. Follow the CLI, dockerd, containerd and runc down to the kernel, with the commands to watch each step. Then get clear answers on image vs container, docker run vs start, containers vs VMs, the performance cost, and when Compose is enough.

Docker
|8 min read

The Docker AuthZ Bypass Is Back: CVE-2026-34040

CVE-2026-34040 lets a crafted API request slip past Docker authorization plugins, and it is an incomplete fix of the 2024 maximum-severity bug. Here is how the bypass works, who is exposed, and how to close it.

Docker
|12 min read

5 Advanced Docker Features Worth Knowing

Go beyond Docker basics with BuildKit, multi-stage builds, health checks, init processes, and build secrets. Learn practical techniques that improve security, performance, and reliability.

Docker
|12 min read

Docker Image Optimization: Best Practices for Smaller, Faster Images

Learn proven strategies to optimize Docker images: multi-stage builds, layer caching, base image selection, and security hardening. Reduce image size by up to 90% while improving build times and security.

Docker
|7 min read

COPY with Docker but with Exclusion

Learn how to use the COPY instruction in Docker with exclusion patterns to optimize your Docker builds.

Docker
|6 min read

How to Set Image Name in Dockerfile

Learn how to set and manage image names effectively in Dockerfiles for streamlined workflows. This guide covers the steps to build Docker images with specific names and tags.

Docker
|18 min read

Forward Host Port to Docker Container

Publish container ports with -p, bind them to localhost, add a port to a container that already runs, understand ports vs expose in Compose, connect to Postgres in a container, find a container IP, and connect containers from different Compose projects.

Docker
|16 min read

How to Access a Docker Container's Shell, Run Commands and Copy Files

Open a shell with docker exec, run one-off commands, get root without sudo, add bash or ps to a slim image, edit and copy files with docker cp, look inside an image that has no shell, and debug a stopped container.

Docker
|7 min read

docker compose: Always Recreate Containers from Fresh Images

Run docker compose up -d --pull always --build --force-recreate to pull newer images, rebuild local ones and replace containers instead of reusing them.

Docker
|12 min read

How to Use Environment Variables in Docker and Docker Compose

Pass environment variables with docker run -e and --env-file, set them in Compose with environment, env_file and .env files, learn which value wins, use defaults and required variables, set ENV and PATH in a Dockerfile, and keep secrets out of all of them.

Docker
|5 min read

Docker: Connect to the Host's localhost from a Container

Use host.docker.internal, not localhost. Docker Desktop resolves it; on Linux add --add-host=host.docker.internal:host-gateway or use --network host.

Docker
|7 min read

How to Get the IP Address of the Docker Host from Inside a Docker Container

Need your container to talk to the Docker host? Learn practical ways to discover the host's IP address from inside a container, with examples for Linux, macOS, and Windows.

Docker
|7 min read

How to List Volumes in Docker Containers

Learn multiple ways to view Docker volumes attached to containers, inspect volume mounts, find volume locations on the host, and understand volume usage across your Docker environment.

Docker
|7 min read

How to Use Multiple Build Arguments in Docker Build

Learn how to pass multiple build-time variables to Docker builds using --build-arg, set default values in Dockerfiles, and use build arguments for environment-specific configurations.

Docker
|14 min read

Fix Docker 'Cannot Connect to the Docker Daemon' and 'Permission Denied' Errors

Fix 'Cannot connect to the Docker daemon at unix:///var/run/docker.sock', permission denied on the Docker socket and on volumes, and 'denied: requested access to the resource is denied' on docker push. Learn why the docker group equals root, and how to harden a Docker host.

Docker
|6 min read

How to Fix Docker "The input device is not a TTY" Error

Learn what causes the Docker TTY error and discover multiple solutions to fix it, from command-line flags to proper terminal configuration for interactive containers.

Docker
|16 min read

How to Rebuild, Restart and Upgrade a Docker Compose Container

restart, up -d, up --build and --force-recreate each apply a different kind of change, and only one of them rebuilds your image. Tested on Compose 5.6: which command picks up which change, how to start only some services, wait for a healthy database, upgrade without losing data, get a shell in a crashed service, and what changed from docker-compose v1.

Docker
|16 min read

Difference Between RUN, CMD and ENTRYPOINT in a Dockerfile

RUN executes at build time, CMD sets the default command, and ENTRYPOINT sets the program that always runs. See how the three combine, why a container exits at once, how to run cron, when ADD beats COPY, and how comments work in a Dockerfile.

Docker
|8 min read

How to Access Host Port from Docker Container

Learn how to access a host machine's port from a Docker container using network configurations and best practices.

Docker
|13 min read

How to Force a Clean Docker Build and Fix Common Build Errors

Rebuild without the cache, fix "docker build requires 1 argument", use files from outside the build context, look inside a build that failed, and give a build SSH keys or secrets without baking them into the image.

Docker
|14 min read

How to Keep Docker Data When a Container Exits: Volumes and Bind Mounts

Data in a container goes away with the container. Learn when that happens, how named volumes and bind mounts keep data, how to add a volume to an existing container, where database images keep their files, and how to back up and remove volumes safely.

Docker
|5 min read

Docker: How to Change Repository Name or Rename an Image

Learn how to rename a Docker image or change its repository name using simple Docker CLI commands. This guide covers real-world scenarios and best practices.

Docker
|13 min read

How to List and Remove Docker Containers and Images

List running and stopped containers, fix "name is already in use", remove old containers and images safely, delete every local image, find where Docker stores its data, and free disk space when Docker fills the disk.