Q. Which Docker command is used to view detailed information about a container?

  • (A) docker inspect container_name
  • (B) docker show container_name
  • (C) docker details container_name
  • (D) docker container info container_name
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker inspect container_name
Explanation: 'docker inspect container_name' provides detailed information about a container.

Q. Which Docker command is used to update the Docker engine?

  • (A) docker upgrade
  • (B) docker update
  • (C) docker engine upgrade
  • (D) docker system upgrade
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker upgrade
Explanation: The 'docker upgrade' command is used to update the Docker engine.

Q. What is the default Docker network for containers?

  • (A) host
  • (B) bridge
  • (C) overlay
  • (D) none
πŸ’¬ Discuss
βœ… Correct Answer: (B) bridge
Explanation: The default Docker network driver is 'bridge', which provides basic network functionality for containers.

Q. Which of the following commands is used to remove all stopped containers?

  • (A) docker container prune
  • (B) docker container remove -a
  • (C) docker remove all containers
  • (D) docker clean containers
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker container prune
Explanation: 'docker container prune' is used to remove all stopped containers.

Q. What is the 'docker-compose.yml' file used for?

  • (A) To define and configure services, networks, and volumes for multi-container Docker applications
  • (B) To store Docker images
  • (C) To configure Docker daemon settings
  • (D) To create Docker networks
πŸ’¬ Discuss
βœ… Correct Answer: (A) To define and configure services, networks, and volumes for multi-container Docker applications
Explanation: 'docker-compose.yml' is used to define and configure services, networks, and volumes for multi-container Docker applications.

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

  • (A) docker image build
  • (B) docker build
  • (C) docker create image
  • (D) docker run build
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker build
Explanation: 'docker build' is used to build an image from a Dockerfile.

Q. Which of the following is used to store Docker container data that persists between restarts?

  • (A) Volumes
  • (B) Containers
  • (C) Images
  • (D) Networks
πŸ’¬ Discuss
βœ… Correct Answer: (A) Volumes
Explanation: Docker volumes are used to store persistent data for containers.

Q. Which of the following Docker commands is used to restart a container?

  • (A) docker restart container_name
  • (B) docker reboot container_name
  • (C) docker start -r container_name
  • (D) docker refresh container_name
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker restart container_name
Explanation: 'docker restart container_name' is used to restart a running container.

Q. Which of the following commands can be used to attach to a running Docker container?

  • (A) docker attach container_name
  • (B) docker exec container_name
  • (C) docker join container_name
  • (D) docker connect container_name
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker attach container_name
Explanation: 'docker attach container_name' allows you to attach to a running Docker container.

Q. What is the default network mode for a Docker container?

  • (A) bridge
  • (B) host
  • (C) none
  • (D) overlay
πŸ’¬ Discuss
βœ… Correct Answer: (A) bridge
Explanation: By default, Docker containers are run in 'bridge' network mode, which connects them to a private network.