πŸ“Š Docker
Q. Which command is used to push an image to Docker Hub?
  • (A) docker push
  • (B) docker upload
  • (C) docker send
  • (D) docker publish
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker push

Explanation: The 'docker push' command uploads an image to Docker Hub.

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

Explanation: The ARG instruction defines build-time variables that can be passed during the image build process.

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

Explanation: The 'docker rename' command renames a container.

πŸ“Š Docker
Q. What is the purpose of the HEALTHCHECK instruction in a Dockerfile?
  • (A) To check the health of 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 check the health of the container

Explanation: The HEALTHCHECK instruction defines a command to check the health of the container.

πŸ“Š Docker
Q. Which command is used to pause a running Docker container?
  • (A) docker pause
  • (B) docker stop
  • (C) docker halt
  • (D) docker freeze
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker pause

Explanation: The 'docker pause' command pauses all processes in a running container.

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

Explanation: The LABEL instruction adds metadata (key-value pairs) to the Docker image.

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

Explanation: The 'docker unpause' command resumes a paused container.

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

Explanation: The ONBUILD instruction triggers commands when the image is used as a base for another image.

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

Explanation: The 'docker history' command shows the history of an image, including its layers.

πŸ“Š Docker
Q. What is the purpose of the STOPSIGNAL instruction in a Dockerfile?
  • (A) To specify the signal to stop 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 signal to stop the container

Explanation: The STOPSIGNAL instruction sets the system call signal to stop the container.