Skip to content
tezvyn:

Docker

99 bites tagged Docker — interview questions with model answers, and 60-second explainers.

Node.js & Express1 min read

Multi-stage Docker builds for lean production images?

Build stage compiles/installs, runtime stage copies artifacts only, discards build tools. Docker build optimization and separation of build and runtime.

Node.js & Express1 min read

What are key Dockerfile steps for Node.js Express apps?

Use lightweight base image, copy app, install deps, expose port, set NODE_ENV, run. Docker containerization fundamentals for Node.js.

Docker & Kubernetes1 min read

Bind mounts vs named volumes for persisting Docker data?

Persist data outside the writable container layer via a bind mount (a host path you control) or a named volume (Docker-managed under its data dir, portable and the recommended default). Docker storage options.

Docker & Kubernetes1 min read

Bind mounts versus named volumes

A bind mount maps a host path into the container (great for live source in dev); a named volume is Docker-managed storage decoupled from the host layout (ideal for database data). Docker storage model.

Docker & Kubernetes1 min read

What is a dangling image and how to prune it

A dangling image is an untagged layer (<none>:<none>) orphaned when a tag moves to a rebuilt image; list with docker images -f dangling=true, remove with docker image prune. image lifecycle and cleanup.

Docker & Kubernetes1 min read

Debug a running container with the Docker CLI

Docker inspect for full state and config, docker logs -f to follow output live, docker exec -it <id> sh or bash for an interactive shell. practical container debugging.

Docker & Kubernetes1 min read

Build, tag, and run a container with port mapping

Docker build -t my-app:1.0 . to build and tag; docker run -d -p 8080:80 my-app:1.0 to run detached with host:container port mapping. core build and run CLI fluency. reversing the port order or forgetting the build context dot.

Docker & Kubernetes1 min read

What is a container vs a VM?

Containers share the host kernel and isolate via namespaces and cgroups; VMs run a full guest OS on a hypervisor; containers are lighter and faster. understanding of OS-level virtualization.

Data Science & Analytics1 min read

Deploy a saved model as a REST prediction service

Load the artifact, wrap it in a predict API, containerize, host with autoscaling, add monitoring. end-to-end deployment basics. jumping to model training or forgetting preprocessing parity and input validation.

Cloud Platforms2 min read

Multi-stage Docker builds

A build stage compiles with the toolchain, the final stage uses a minimal base and copies only the artifact, cutting size and attack surface. separating build tooling from runtime. shipping compilers and source.

Cloud Platforms1 min read

Writing a Dockerfile for a web app

FROM a base, set WORKDIR, install dependencies before app code for cache reuse, EXPOSE the port, CMD the start command. core Dockerfile instructions and layering. copying everything before installing deps, or root.

Cloud Platforms2 min read

CI/CD pipeline for a container PaaS

Run tests, build the image, push the tag to a registry, then deploy it to Cloud Run. The registry is the build-to-deploy handoff. the build-push-deploy pipeline. skipping the registry or rebuilding on the deploy host.

Docker & Kubernetes2 min read

Docker layers and build cache efficiency

Each instruction makes a content-addressed read-only layer stacked by a union FS; shared layers are pushed/pulled once, and ordering the Dockerfile so volatile steps come last maximizes cache reuse. layer/union FS and caching.

Docker & Kubernetes1 min read

Create a Deployment with 3 replicas via kubectl

Kubectl create deployment webapp --image=my-app:1.0, then kubectl scale to 3 replicas, or use --replicas if supported. Basic kubectl Deployment fluency.

Docker & Kubernetes1 min read

Manifest lists and multi-arch images

A manifest list maps platform descriptors to per-arch image manifests, the client picks by os and architecture, and pulls only that variant. how one tag serves multiple architectures.

Docker & Kubernetes1 min read

Three techniques to shrink a Docker image

Multi-stage builds to drop build tooling, smaller base images like slim or distroless, and fewer or cleaner layers plus dockerignore. practical image-size reduction with trade-offs.

Docker & Kubernetes1 min read

Tag and push an image to a private registry

Authenticate with docker login, retag the image to include the registry host and repo path, then docker push that full reference. tag-and-push workflow plus registry auth.

Docker & Kubernetes1 min read

Docker Compose profiles for optional services

Profiles tag services so they stay off by default, activate via --profile or COMPOSE_PROFILES, and unprofiled services always run. gating optional services in one Compose file.

Docker & Kubernetes1 min read

Optimizing Dockerfile layer caching

Order instructions least-to-most volatile, copy dependency manifests and install before copying source, and understand any changed layer busts all later layers. how layer caching invalidation works.

Docker & Kubernetes1 min read

Structuring Compose files across environments

A base compose.yaml plus override files, the default override auto-merge, and explicit -f flags or extends per environment. Compose override and merge mechanics.

Python & FastAPI2 min read

Explain multi-stage Docker builds for Python and builder vs runtime

Tests separation of build-time and runtime concerns. A strong answer contrasts the builder stage (gcc, headers, wheels) with the runtime stage (slim base, copied artifacts, no compiler). Red flag: citing size alone while ignoring security and caching.

Python & FastAPI2 min read

How do you manage configuration and secrets for a containerized FastAPI app?

Tests 12-factor config separation and Docker secret hygiene. A strong answer uses pydantic-settings with runtime env vars, lru_cache, and keeps .env out of the image. Red flag: baking credentials into Dockerfile layers or committing .env files.

Python & FastAPI2 min read

Walk me through a basic Dockerfile for a FastAPI app

Slim base, install deps before app code to cache layers, expose port, exec-form CMD for Uvicorn. Docker layering and build cache for Python containers. Shell-form CMD or code-before-requirements, killing cache.

Python & FastAPI2 min read

Docker Compose for Local FastAPI Stacks

Docker Compose turns your laptop into a one-command datacenter. Define Postgres, Redis, and your FastAPI app in one YAML file and they boot as a networked stack.

Get Docker bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.