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

When you set `--memory 256m` on a `docker run` command, which Linux kernel mechanism actually enforces the limit?

#2Multiple Choice

What happens to data stored in a container's writable layer when the container is deleted via `docker rm`?

#3Multiple Choice

Which namespace type isolates process IDs so a container cannot see processes running on the host?

#4Multiple Choice

Why should `COPY package*.json ./` precede `COPY . .` in a Node.js Dockerfile?

#5Multiple Choice

What host interface handles inbound traffic translation for port mapping (`docker run -p 8080:80`) in default bridge mode?

#6Multiple Choice

Which command detaches an interactive container session without stopping its execution?

#7Scenario

A developer complains that changes to local source code files are not appearing inside their running Node.js development container. They ran `docker run -d -p 3000:3000 my-node-app`. What storage mechanism is missing?

#8Scenario

Your web container crashes immediately after starting with exit code 0. Running `docker logs` shows: 'Nginx started in background'. Why did the container exit?

#9Scenario

You notice `docker build` uploads a 4.2 GB build context to the Docker daemon every time you run it, even though your project is only 20 MB. What file is missing from your project root?

#10Scenario

Two containers on the default bridge network try to ping each other by container name ('api-service' -> 'db-service'), but DNS resolution fails. How do you enable automatic container name resolution?

#11Code Fill

Complete the Docker CLI command to execute an interactive bash shell inside a running container named `prod-api`:

docker exec ___ prod-api bash
#12Code Fill

Complete the Dockerfile instruction to set the working directory for all subsequent instructions to `/usr/src/app`:

___ /usr/src/app
#13Code Fill

Complete the Compose key to ensure a service container automatically restarts unless explicitly stopped:

services:
  web:
    image: nginx
    ___: unless-stopped
#14Open Ended

Explain the difference between the `CMD` and `ENTRYPOINT` instructions in a Dockerfile.

#15Open Ended

Why is running a container as the `root` user considered a security vulnerability, and how do you remediate it?