πŸ“Š Docker
Q. Which command is used to pull an image from Docker Hub?
  • (A) docker pull
  • (B) docker fetch
  • (C) docker download
  • (D) docker get
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker pull

Explanation: The 'docker pull' command downloads an image from Docker Hub.

πŸ“Š Docker
Q. What is the purpose of the VOLUME instruction in a Dockerfile?
  • (A) To create a persistent data volume
  • (B) To mount a host directory into the container
  • (C) To define a network volume
  • (D) To specify a shared volume between containers
πŸ’¬ Discuss
βœ… Correct Answer: (A) To create a persistent data volume

Explanation: The VOLUME instruction creates a persistent data volume in the container.

πŸ“Š Docker
Q. Which command is used to list all Docker images on the local machine?
  • (A) docker images
  • (B) docker list
  • (C) docker ps
  • (D) docker ls
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker images

Explanation: The 'docker images' command lists all Docker images stored locally.

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

Explanation: The WORKDIR instruction sets the working directory for subsequent instructions in the Dockerfile.

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

Explanation: The 'docker rmi' command removes one or more Docker images.

πŸ“Š Docker
Q. What is the purpose of the COPY 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 COPY instruction copies files or directories from the host machine into the Docker image.

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

Explanation: The 'docker start' command starts a stopped container.

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

Explanation: The ENV instruction sets environment variables inside the container.

πŸ“Š Docker
Q. Which command is used to inspect a Docker container?
  • (A) docker inspect
  • (B) docker view
  • (C) docker logs
  • (D) docker info
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker inspect

Explanation: The 'docker inspect' command provides detailed information about a container.

πŸ“Š Docker
Q. What is the purpose of the USER instruction in a Dockerfile?
  • (A) To define the user for running commands
  • (B) To set environment variables
  • (C) To specify the working directory
  • (D) To copy files into the container
πŸ’¬ Discuss
βœ… Correct Answer: (A) To define the user for running commands

Explanation: The USER instruction specifies the user or UID for running commands in the container.