Which statement best describes how Docker image layers work?
Think about how Docker saves space and speeds up builds by reusing parts.
Docker images are built in layers. Each layer represents changes from the previous one. This allows sharing common parts between images and efficient storage.
In a typical Docker setup, how do containers communicate with each other on the same host?
Think about how Docker isolates containers but still allows them to talk inside the same machine.
Docker creates a virtual bridge network on the host. Containers connect to this bridge and can communicate using internal IPs, isolated from the host network.
You have a microservice running in a Docker container that needs to handle increased traffic. Which approach best supports scaling this service?
Think about horizontal scaling and distributing load.
Scaling microservices is best done by running multiple container instances and balancing traffic among them. This approach improves availability and handles more users.
When persisting data for Docker containers, what is a key tradeoff between using Docker volumes and bind mounts?
Consider management, portability, and permission differences.
Docker volumes are stored in Docker-managed locations and are portable across hosts. Bind mounts link directly to host files or directories, which can cause permission and portability challenges.
You plan to deploy 100 Docker containers running a CPU-intensive microservice on a server with 64 CPU cores and 256 GB RAM. Each container requires 0.5 CPU cores and 2 GB RAM. What is the minimum number of such servers needed to run all containers without resource contention?
Calculate total CPU and RAM needed, then divide by server capacity.
Total CPU needed: 100 containers * 0.5 cores = 50 cores.
Total RAM needed: 100 containers * 2 GB = 200 GB.
One server has 64 cores (>50) and 256 GB RAM (>200 GB), so the minimum number of servers needed is 1.