1. Which command is used to check the installed version of Docker?

    Answer: b) docker --version

  2. How do you start a Docker container?

  3. Which command lists all running Docker containers?

    Answer: c) docker ps

  4. Which command lists all Docker containers, including stopped ones?

    Answer: b) docker ps -a

  5. What does CMD instruction in Dockerfile do?

    Answer: c) Provides the default command to run when a container starts

  6. What does ENTRYPOINT instruction in Dockerfile do?

Answer: c) Provides the command to run when a container starts and cannot be overridden

  1. What does the FROM instruction in Dockerfile specify?

    Answer: b) The base image to use for creating the Docker image

  2. Which Dockerfile instruction sets the working directory for subsequent instructions?

    Answer: a) WORKDIR

  3. Which Dockerfile instruction is used to copy files from host to container?

    Answer: b) COPY

  4. What is the difference between COPY and ADD instruction in Dockerfile?

    Answer: a) ADD can copy files from a URL, COPY cannot

  5. Which command is used to build a Docker image from a Dockerfile?

    Answer: b) docker build

  6. Which command is used to remove a Docker container?

  7. Which command is used to remove a Docker image?

  8. What is the default name of the Dockerfile?

    Answer: b) Dockerfile

  9. Which command is used to view the logs of a running container?

  10. What does the RUN instruction do in a Dockerfile?

  11. Which command is used to stop a running Docker container?

  12. Which of the following command is used to push a Docker image to a registry?

  13. What is the purpose of the EXPOSE instruction in a Dockerfile?