Active Nerds
Review all 15 questions for Docker (intermediate).Plain Q&A (No XP)
#1Multiple Choice

In a multi-stage Dockerfile, what flag is passed to `COPY` to copy build artifacts from an earlier stage named `builder`?

#2Multiple Choice

What is the primary difference between `docker run --net=host` and standard bridge networking?

#3Multiple Choice

Which command inspects the exact layer history and commands used to build a Docker image?

#4Multiple Choice

What Docker daemon log driver setting limits log file disk consumption to prevent disk full outages?

#5Multiple Choice

What is the function of the OCI (Open Container Initiative) `runc` component?

#6Multiple Choice

Which Docker Compose condition key forces a service to wait until a dependent database container passes its healthcheck?

#7Scenario

Your production Go API image is 850 MB because it includes the Go compiler and build dependencies. How do you reduce its final image size below 25 MB without breaking compilation?

#8Scenario

In your CI pipeline, `docker build` takes 8 minutes on every commit because `RUN apt-get update && apt-get install -y gcc` re-executes. The Dockerfile has `COPY . .` on line 3 and `RUN apt-get...` on line 5. How do you fix CI speed?

#9Scenario

An API container connecting to a Postgres container crashes on startup with 'connection refused'. Both containers are in `compose.yaml` with `depends_on: [db]`. Why did `depends_on` fail to prevent the crash?

#10Scenario

A developer tags a newly built image as `my-api:latest` and pushes it to the registry. The production deployment uses `:latest` but does not pull the updated image on pod restart. Why?

#11Code Fill

Complete the Docker CLI command to mount the host directory `/var/data` as a read-only volume inside the container at `/data`:

docker run -v /var/data:/data:___ nginx
#12Code Fill

Complete the Dockerfile syntax to set an environment variable `NODE_ENV` to `production`:

___ NODE_ENV=production
#13Code Fill

Complete the Docker command to remove all unused images, stopped containers, and dangling build caches in one command:

docker system ___ --all --volumes
#14Open Ended

Explain how OverlayFS (Overlay2) works in Docker to combine image layers into a single filesystem view.

#15Open Ended

What is the security advantage of Google Distroless base images over Alpine Linux base images?