Concepts in Docker & Kubernetes, page 2
Docker Compose Services: Defining Your App's Components
A service in Docker Compose is a blueprint for a running container. You define its image, ports, and environment to describe one piece of your application, like a web server or database. The footgun is using build and image together for one service.
Docker Compose: Orchestrate Multi-Container Apps Locally
docker compose is a conductor for multi-container apps, using a single YAML file to define and run all the parts of your stack together. It's ideal for local development to spin up a database and API with one command.
Docker Compose Networking: How Services Talk to Each Other
Docker Compose puts your services on a private network, letting them communicate using service names as hostnames. This is how a 'web' container finds your 'db' container. The footgun is using localhost; always use the service name for inter-container calls.
Environment Variables in Docker Compose
Environment variables are the runtime knobs for your Docker Compose services, letting you pass configuration like API keys or database URLs without rebuilding your image. Use them to connect services or set feature flags.
Docker Compose: Control Startup with `depends_on`
depends_on controls service startup order in Docker Compose, ensuring a database starts before your app. The footgun: it only waits for the container to start, not for the application inside to be ready. Use healthcheck for true readiness.
Building Images with Docker Compose
Docker Compose builds images from a compose.yml file, turning a Dockerfile into a runnable service within a multi-container app. It's for local dev where you need a database and backend to start together. The footgun: up won't rebuild without --build.
Docker Compose Profiles: Activate Service Groups
Docker Compose profiles let you toggle groups of services on or off within a single compose.yaml file. Use it to separate your core app from debugging utilities or to define a "local dev" setup versus a "CI" setup.
Extending Compose Files for Different Environments
Think of extending Compose files like CSS for your services; a base file defines the structure, and override files style it for different environments. This is used to manage settings like local code mounts for dev vs. restart policies for prod.
Docker Compose Secrets: Keep Credentials Out of Your Code
Docker Compose Secrets inject sensitive data into containers as files at runtime, keeping credentials out of your version-controlled docker-compose.yml. Use them for API keys and passwords. The footgun: your app must read from a file, not an env var.
Docker Hub: The Central Repository for Containers
Think of Docker Hub as the GitHub for Docker images. It's a central repository from Docker, Inc. for finding, storing, and sharing pre-built software containers to automate code deployment.
Docker Push and Pull: Moving Container Images
Think of docker push and pull like git push and pull, but for container images. They move images between your machine and a remote registry. A common mistake is forgetting to tag an image with the registry's full address before pushing.
Docker Login: Authenticating to a Container Registry
docker login saves your credentials for a container registry, letting you push and pull private images. Use it before interacting with private repos on Docker Hub, ECR, or GCR. The footgun: credentials are often stored unencrypted by default.
Docker Image Prune: Reclaim Your Disk Space
Docker image prune is a garbage collector for your local Docker setup, deleting unused images to free up disk space. Use it when low on storage after many builds. The footgun: by default, it only removes *dangling* (untagged) images, not all unused ones.
Amazon EC2: Rentable Virtual Servers on AWS
Amazon EC2 is like renting virtual computers, letting you run applications without buying physical hardware. It's used for scalable deployments where you can launch and terminate servers as needed, paying only for what you use.
Artifact Registry: Google's Universal Package Manager
Artifact Registry is a private, universal package manager for all your software components, not just Docker images. Use it to store your company's Docker images, Java JARs, and Helm charts in one place, integrated with GCP CI/CD.
Image Digest: The Immutable Image Identifier
An image digest is a unique fingerprint for a container image, guaranteeing you get the exact version you expect. Use it in production to pin an image, preventing unexpected updates from mutable tags like :latest. The footgun is assuming a tag is immutable.
Docker Registry Mirror: A Local Cache for Faster Pulls
A registry mirror is like a CDN for Docker images, caching public images on your local network to speed up pulls and avoid rate limits. Use it in CI/CD pipelines to reduce build times. The footgun: you can't docker push to a mirror; it's a.
OCI Image Manifest: The Recipe for a Container Image
An OCI Image Manifest is the recipe for a single container image, listing its configuration and filesystem layers for one specific architecture. It's what a runtime uses to assemble an image like ubuntu:22.04 on your linux/amd64 machine.
Harbor: A Private, Secure Artifact Registry
Think of Harbor as a private Docker Hub with built-in security. Use it to scan images for vulnerabilities, enforce role-based access control, and sign artifacts before deploying to Kubernetes.

Container Image Signing: Verifying What You Run
Think of image signing as a digital "tamper-evident seal" on your containers. It proves who built an image and that it hasn't been altered. This is crucial for production systems to prevent running malicious code.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles