15 questions0s
See the answer and explanation right after each question
1
What is the fundamental OS-related difference between a container and a virtual machine?
2
Which command shows ALL containers (including stopped ones)?
3
You run
docker run --rm ubuntu:22.04 echo "hello". What happens to the container after the command finishes?4
Look at the following Dockerfile. What is the layer caching problem?
FROM node:24-alpine WORKDIR /app COPY . . RUN npm install EXPOSE 3000 CMD ["node", "server.js"]
5
Which statement about the difference between the
CMD exec form and shell form is correct?
CMD ["node", "server.js"] # exec form CMD node server.js # shell form
6
What is the main problem that a multi-stage build solves?
7
A Dockerfile uses
ARG DB_PASSWORD=secret and the value is passed via docker build --build-arg DB_PASSWORD=real_pass. After the build finishes, can an attacker retrieve real_pass?8
In Docker Compose, the
web service needs to connect to the db service running Postgres on port 5432. Which URL is correct for DATABASE_URL?9
Which command stops and removes all containers of a Compose project but KEEPS the data volumes?
10
What does
docker-compose.override.yml do when you run docker compose up?11
When authenticating the Docker CLI with Amazon ECR, what is the username in the
docker login command?12
You want to deploy a web API on AWS with these requirements: you don't want to manage EC2 servers, the load is unpredictable (bursts at peak hours), and some long-running requests can exceed 15 minutes. Which service is the best fit?
13
How does
ecsTaskExecutionRole differ from ecsTaskRole?14
A running container crashes and exits right after starting. Which command is best for debugging the problem WITHOUT restarting the container?
15
Select all that apply
The repo already has a
.dockerignore that excludes .env, .git and node_modules. What security problems does the following Dockerfile have? (Choose 2)
FROM python:3.12 WORKDIR /app COPY requirements.txt . RUN pip install -r requirements.txt COPY . . ENV DATABASE_PASSWORD=prod_secret_123 CMD ["python", "app.py"]