Q. Which of the following options is correct about Docker images?

  • (A) Docker images are immutable and cannot be modified once created
  • (B) Docker images are ephemeral and get deleted once the container is stopped
  • (C) Docker images are temporary storage areas for containers
  • (D) Docker images are used to store container logs
πŸ’¬ Discuss
βœ… Correct Answer: (A) Docker images are immutable and cannot be modified once created
Explanation: Docker images are immutable and cannot be modified once created. If changes are needed, a new image must be built.

Q. Which command is used to check the logs of a running Docker container?

  • (A) docker logs container_name
  • (B) docker inspect container_name
  • (C) docker stats container_name
  • (D) docker ps container_name
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker logs container_name
Explanation: 'docker logs container_name' shows the logs of a running container.

Q. Which of the following is true about Docker Compose?

  • (A) Docker Compose allows you to run multiple containers in a single command
  • (B) Docker Compose is used to monitor the health of Docker containers
  • (C) Docker Compose is used to manage Docker images
  • (D) Docker Compose can only be used for building Docker images
πŸ’¬ Discuss
βœ… Correct Answer: (A) Docker Compose allows you to run multiple containers in a single command
Explanation: Docker Compose allows you to define and manage multi-container Docker applications in a single file and run them with a single command.

Q. What is the purpose of the 'docker volume' command?

  • (A) To manage Docker containers
  • (B) To manage persistent storage for Docker containers
  • (C) To list Docker images
  • (D) To create new networks in Docker
πŸ’¬ Discuss
βœ… Correct Answer: (B) To manage persistent storage for Docker containers
Explanation: 'docker volume' is used to create, list, and manage volumes in Docker, which are used for persistent data storage.

Q. Which of the following Docker commands is used to view resource usage statistics for a container?

  • (A) docker top container_name
  • (B) docker stats container_name
  • (C) docker inspect container_name
  • (D) docker resource container_name
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker stats container_name
Explanation: 'docker stats container_name' provides resource usage statistics for a running container.

Q. Which command is used to build a Docker image from a Dockerfile?

  • (A) docker build -t image_name .
  • (B) docker create image_name
  • (C) docker run -d image_name
  • (D) docker deploy image_name
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker build -t image_name .
Explanation: 'docker build -t image_name .' builds a Docker image from a Dockerfile located in the current directory.

Q. Which Docker component manages the network configuration of containers?

  • (A) Docker daemon
  • (B) Docker volume
  • (C) Docker Swarm
  • (D) Docker network
πŸ’¬ Discuss
βœ… Correct Answer: (D) Docker network
Explanation: Docker network manages the network configuration for containers, including creating isolated networks for communication between containers.

Q. Which Docker command can be used to check the available Docker networks?

  • (A) docker network list
  • (B) docker network show
  • (C) docker network ls
  • (D) docker network inspect
πŸ’¬ Discuss
βœ… Correct Answer: (C) docker network ls
Explanation: 'docker network ls' lists all the available networks in Docker.

Q. What does the 'docker tag' command do?

  • (A) Creates a new Docker image
  • (B) Renames a Docker container
  • (C) Tags a Docker image with a version or label
  • (D) Runs a Docker container
πŸ’¬ Discuss
βœ… Correct Answer: (C) Tags a Docker image with a version or label
Explanation: 'docker tag' is used to assign a tag (like a version) to an existing Docker image.

Q. Which of the following is true about Docker containers?

  • (A) Docker containers are lightweight and can be started and stopped quickly
  • (B) Docker containers run as virtual machines on the host OS
  • (C) Docker containers require separate operating systems
  • (D) Docker containers are permanently linked to the host system
πŸ’¬ Discuss
βœ… Correct Answer: (A) Docker containers are lightweight and can be started and stopped quickly
Explanation: Docker containers are lightweight, isolated environments that share the host OS kernel, which allows them to start and stop quickly.