Linux+ Container Operations with Docker Flashcards
7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Linux+ Container Operations with Docker flashcards as text
Which Linux kernel feature provides process isolation between containers by giving each container its own view of system resources like PIDs and hostnames?
Answer: namespaces
Linux namespaces isolate containers by providing separate process trees, network interfaces, mount points, and user IDs per container.
A running container's logs need to be followed in real time. Which command accomplishes this?
Answer: docker logs -f container_name
docker logs -f (follow) streams new log output from a container's stdout and stderr as it is generated.
What is the function of the .dockerignore file?
Answer: It specifies files and directories to exclude from the build context sent to the Docker daemon
.dockerignore reduces build context size and prevents sensitive files like .git or .env from being sent to the Docker daemon during builds.
Which docker run flag makes a container automatically restart unless it is explicitly stopped by the administrator?
Answer: --restart=unless-stopped
unless-stopped restarts the container automatically after crashes or reboots, but respects a manual docker stop command.
A container must write temporary data quickly without persisting it to disk. Which volume type provides an in-memory filesystem for this purpose?
Answer: tmpfs mount
A tmpfs mount stores data in the host's RAM only; it is fast and automatically discarded when the container stops.
Which command saves a Docker image to a tar archive file for offline transfer?
Answer: docker save myimage -o myimage.tar
docker save exports an image including all its layers and tags to a tar file that can be loaded on another host with docker load.
What does setting a container's --memory flag to 256m enforce?
Answer: The container is killed by the OOM killer if it tries to use more than 256 MB of RAM
The --memory flag sets a hard memory limit; if the container exceeds it, the Linux OOM killer terminates the container process.