1. What is db2 primarily used for?
A. Virtual Machine Management
B. Application Deployment in Containers
C. File System Encryption
D. Network Configuration
Answer: B. Application Deployment in Containers
3. Which command is used to create and start a Docker container?
A. docker e start
B. docker run
C. docker
D. docker init
Answer: B. docker run
4. What does the docker ps command do?
A. Lists available Docker images
B. Lists all processes running on the host
C. Lists running Docker containers
D. Lists stopped containers
Answer: C. Lists running Docker containers
5. What is Docker Hub?
A. Docker’s file system
B. A web server for hosting APIs
C. A cloud-based registry for Docker images
D. A local storage for containers
Answer: C. A cloud-based registry for Docker images
6. What is the difference between a Docker image and a container?
A. An image is running, a container is static
B. A container is a blueprint, an image is running
C. An image is the blueprint, and a container is a running instance
D. No difference
Answer: C. An image is the blueprint, and a container is a running instance
7. What does the -d flag do in Docker?
A. Deletes the container
B. Runs the container in detached mode
C. Displays logs
D. Deploys the container to production
Answer: B. Runs the container in detached mode
8. How can you stop a running Docker container?
A. docker remove
B. docker stop [container_id]
C. docker halt
D. docker pause
Answer: B. docker stop [container_id]
9. What is the function of the Dockerfile?
A. Logs container activities
B. Defines the container's memory limit
C. Contains instructions to build a Docker image
D. Stores container environment variables
Answer: C. Contains instructions to build a Docker image
10. Which command is used to build a Docker image from a Dockerfile?
A. docker init
B. docker compile
C. docker build
D. docker make
Answer: C. docker build
11. What is the default network driver in Docker?
A. Host
B. None
C. Bridge
D. Overlay
Answer: C. Bridge
12. How can you remove all stopped containers in Docker?
A. docker clean
B. docker rm $(docker ps -a -q)
C. docker stop --all
D. docker down
Answer: B. docker rm $(docker ps -a -q)
13. Which Docker command is used to push an image to Docker Hub?
A. docker deploy
B. docker image upload
C. docker push
D. docker export
Answer: C. docker push
14. What does docker-compose help with?
A. Monitoring container performance
B. Configuring network settings
C. Defining and running multi-container Docker applications
D. Building Docker images
Answer: C. Defining and running multi-container Docker applications
15. Which file is used by docker-compose to configure services?
A. Dockerfile
B. compose.json
C. services.xml
D. docker-compose.yml
Answer: D. docker-compose.yml