πŸ“Š Docker
Q. Which command is used to create a Docker network?
  • (A) docker network create
  • (B) docker create network
  • (C) docker net create
  • (D) docker add network
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker network create

Explanation: The 'docker network create' command creates a new Docker network.

πŸ“Š Docker
Q. What is the purpose of the SHELL instruction in a Dockerfile?
  • (A) To specify the default shell for the container
  • (B) To define the base image
  • (C) To specify the working directory
  • (D) To copy files into the container
πŸ’¬ Discuss
βœ… Correct Answer: (A) To specify the default shell for the container

Explanation: The SHELL instruction specifies the default shell for the container.

πŸ“Š Docker
Q. Which command is used to list Docker networks?
  • (A) docker network ls
  • (B) docker list networks
  • (C) docker net ls
  • (D) docker show networks
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker network ls

Explanation: The 'docker network ls' command lists all Docker networks.

πŸ“Š Docker
Q. What is the purpose of the ADD instruction in a Dockerfile?
  • (A) To copy files from the host to the container
  • (B) To copy files between containers
  • (C) To copy files from the container to the host
  • (D) To create a backup of the container
πŸ’¬ Discuss
βœ… Correct Answer: (A) To copy files from the host to the container

Explanation: The ADD instruction copies files or directories from the host into the container.

πŸ“Š Docker
Q. Which command is used to remove a Docker network?
  • (A) docker network rm
  • (B) docker remove network
  • (C) docker net rm
  • (D) docker delete network
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker network rm

Explanation: The 'docker network rm' command removes a Docker network.

πŸ“Š Docker
Q. What is Docker Compose used for?
  • (A) Building Docker images
  • (B) Managing multi-container applications
  • (C) Monitoring Docker containers
  • (D) Creating container snapshots
πŸ’¬ Discuss
βœ… Correct Answer: (B) Managing multi-container applications

Explanation: Docker Compose is used to define and manage multi-container applications.

πŸ“Š Docker
Q. Which file format does Docker Compose use?
  • (A) JSON
  • (B) YAML
  • (C) XML
  • (D) INI
πŸ’¬ Discuss
βœ… Correct Answer: (B) YAML

Explanation: Docker Compose uses YAML files to define services and configurations.

πŸ“Š Docker
Q. What is the default name of the Docker Compose configuration file?
  • (A) docker-compose.yml
  • (B) compose.json
  • (C) dockerfile.yaml
  • (D) config.compose
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker-compose.yml

Explanation: The default file name for Docker Compose configurations is 'docker-compose.yml'.

πŸ“Š Docker
Q. Which command is used to start services defined in a Docker Compose file?
  • (A) docker-compose build
  • (B) docker-compose start
  • (C) docker-compose up
  • (D) docker-compose init
πŸ’¬ Discuss
βœ… Correct Answer: (C) docker-compose up

Explanation: The 'docker-compose up' command starts services defined in the compose file.

πŸ“Š Docker
Q. How can you run Docker Compose in detached mode?
  • (A) docker-compose run -d
  • (B) docker-compose up -d
  • (C) docker-compose start -d
  • (D) docker-compose detach
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker-compose up -d

Explanation: Using the '-d' flag with 'docker-compose up' runs the services in detached mode.