Q. What is Docker primarily used for?

  • (A) Virtualization
  • (B) Containerization
  • (C) Cloud Storage
  • (D) Web Hosting
πŸ’¬ Discuss
βœ… Correct Answer: (B) Containerization
Explanation: Docker is mainly used for containerization, which allows applications to run in isolated environments.

Q. Which command is used to list all running Docker containers?

  • (A) docker ps
  • (B) docker list
  • (C) docker show
  • (D) docker containers
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker ps
Explanation: The 'docker ps' command lists all running Docker containers.

Q. Which file is used to define a Docker image build process?

  • (A) Dockerfile
  • (B) docker-compose.yml
  • (C) Docker.config
  • (D) Docker.json
πŸ’¬ Discuss
βœ… Correct Answer: (A) Dockerfile
Explanation: A Dockerfile contains the instructions for building a Docker image.

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

  • (A) Starts a new container
  • (B) Stops a container
  • (C) Removes a container
  • (D) Lists all containers
πŸ’¬ Discuss
βœ… Correct Answer: (A) Starts a new container
Explanation: The 'docker run' command is used to start a new container from an image.

Q. Which Docker command is used to download an image from Docker Hub?

  • (A) docker get
  • (B) docker pull
  • (C) docker download
  • (D) docker import
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker pull
Explanation: The 'docker pull' command is used to download a Docker image from a registry like Docker Hub.

Q. What is Docker?

  • (A) A programming language
  • (B) A containerization platform
  • (C) A cloud service provider
  • (D) A database management system
πŸ’¬ Discuss
βœ… Correct Answer: (B) A containerization platform
Explanation: Docker is a platform designed to develop, ship, and run applications in containers.

Q. Which command is used to create a new Docker container?

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

Q. What is a Docker image?

  • (A) A running instance of a container
  • (B) A template for creating containers
  • (C) A virtual machine
  • (D) A Docker network
πŸ’¬ Discuss
βœ… Correct Answer: (B) A template for creating containers
Explanation: A Docker image is a read-only template that contains instructions for creating a Docker container.

Q. Which command lists all running Docker containers?

  • (A) docker ps
  • (B) docker ls
  • (C) docker list
  • (D) docker containers
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker ps
Explanation: The 'docker ps' command lists all running containers.

Q. What is the purpose of Docker Compose?

  • (A) To build Docker images
  • (B) To manage multiple containers as a single service
  • (C) To monitor Docker containers
  • (D) To create Docker networks
πŸ’¬ Discuss
βœ… Correct Answer: (B) To manage multiple containers as a single service
Explanation: Docker Compose is used to define and manage multi-container Docker applications.