Skip to Content
Skip to content
236 results
Docker
Tag an Image With a Version and latest Level: Intermediate

Tag one build with a version, latest and a commit name, then release the next version without moving the old tag. After this, you can roll back with one command.

Docker
Wait for a Dependency With a Healthcheck Level: Intermediate

Add a pg_isready health check to a database and make the app wait for it with service_healthy. After this, you can stop an app from failing on a database that is still starting.

Docker
Cut Rebuild Time With a BuildKit Cache Mount Level: Advanced

Add a BuildKit cache mount to pip install so a changed requirements file downloads only the new packages.

Docker
Multi-Stage Node or Go Image Under 50 MB Level: Advanced

Build a Go service in a multi-stage Dockerfile and ship it in an image well under 50 MB, with a non-root user and a health check.

Docker
Run the Container as a Non-Root User Level: Advanced

Add a user to an image, give it only the folder it writes to, and fix the two permission errors you will most likely hit. After this, your containers stop running as root.

Docker
Pin a Base Image by Digest Level: Advanced

Look up a base image digest, pin it in the FROM line, check the build used it and plan how to update it. After this, your builds are repeatable without missing security fixes.

Docker
Add a HEALTHCHECK That Actually Fails Level: Advanced

Break an app on purpose and compare three health checks, then put the one that works in the Dockerfile. After this, unhealthy means the app is broken, not the check.

Docker
Cap CPU and Memory So One Container Can't Starve the Host Level: Advanced

Set CPU and memory limits, watch them work, change them on a running container and set them in Compose. After this, one busy container cannot take the whole machine.

Docker
Apply and Verify Log Rotation on an Existing Compose Service Level: Advanced

Show why restart leaves old log settings in place, recreate one service with bounded logging, and verify retained messages without changing engine defaults.

Docker
Log In to a Private Registry From CI Level: Advanced

Log in to a password-protected registry the way a CI job should, push an image, log out, and see the GitHub Actions version. After this, CI logins stop leaking tokens.

Docker
Read-Only Root Filesystem With a Writable tmpfs Level: Advanced

Find where an app writes, run it read-only, and give it a tmpfs for scratch files and a volume for data. After this, nothing inside the container can change its own files.

Docker
Zero-Downtime Restart With Compose on One Host Level: Advanced

Deploy a new version with blue and green copies, a proxy reload and a switch script, and prove no request failed. After this, a deployment on one host does not drop users.