Level 1 exam — harder

Exam — fresh questions

1.1 · Recall

1. What does the tag mean in 'postgres:16.4'?

The tag designates the variant: 16 pins the major, 16.4 the minor — reproducible, unlike latest.
1.1 · Application

2. Idir is preparing the production database. Which image should he keep?

Official, up to date, pinned and noted tag: the only acceptable combination in production.
1.1 · Application

3. Why do ten images based on the same Debian download the base only once?

Read-only layers are shared: only missing layers are downloaded.
1.2 · Recall

4. In '-p 8080:80', what do 8080 and 80 mean?

Left = host, right = container: http://localhost:8080 reaches port 80 of the container.
1.2 · Application

5. Idir launches a long-lived Nginx server. Which command?

Service = -d (background) + --name (manageable) + -p (reachable) + pinned tag; -it would block the terminal.
1.2 · Arbitration

6. The password passed with -e must change. What is the right call?

Variables with -e are frozen at creation: delete and relaunch — or version via Compose (level 3).
1.3 · Application

7. Idir wants his database to survive rm of the container. What should he do?

Only a mount outside the container survives rm; stop keeps everything but is not persistence.
1.3 · Arbitration

8. Should you run 'docker volume prune' on a shared machine without checking?

prune permanently deletes orphan volumes: list (ls), identify, then clean.
1.4 · Recall

9. What do you gain with a dedicated network (network create) versus the default bridge?

A dedicated network enables DNS by name: no more changing IPs of the default bridge.
1.4 · Application

10. On monapp, how does the web reach the database named 'bdd'?

The name stays valid after every relaunch; the database stays internal, only the frontend is published.
1.5 · Application

11. Idir's web is in Exited (1). First reflex?

State guides, logs accuse, inspection confirms: fix the cause, not the symptom.
1.5 · Arbitration

12. 'docker exec -it web sh' answers 'container not running'. What is the right call?

exec = running; stopped = logs + inspect first, then start or throwaway inspection of the image.
What's next?
Back to the guideGuide contents