Questions:

  1. What is Docker primarily used for?

    a) Virtualizing hardware

    b) Containerizing applications

    c) Managing databases

    d) Writing software code

  2. Which component runs containers and manages Docker objects?

    a) Docker CLI

    b) Docker Engine

    c) Docker Hub

    d) Docker Compose

  3. What is a Docker image?

    a) A running container

    b) A read-only template for creating containers

    c) A volume for data persistence

    d) A network configuration

  4. What command downloads an image from Docker Hub?

    a) docker run

    b) docker pull

    c) docker build

    d) docker start

  5. Which command lists currently running containers?

    a) docker ps

    b) docker ls

    c) docker images

    d) docker status

  6. What is the primary difference between Docker containers and Virtual Machines?

    a) Containers share the host OS kernel, VMs run separate OS

    b) VMs are faster to start

    c) Containers require more storage space

    d) VMs share the host OS kernel

  7. Which Docker component provides a cloud-based registry for images?

    a) Docker CLI

    b) Docker Daemon

    c) Docker Hub

    d) Dockerfile

  8. How do you access a running container’s shell?

    a) docker shell

    b) docker run -it

    c) docker exec -it <container_id> sh

    d) docker start

  9. Which command stops a running container?

    a) docker kill

    b) docker stop

    c) docker pause

    d) docker remove

  10. What file contains instructions to build a Docker image?

    a) Dockerfile

    b) docker-compose.yml

    c) Dockerimage

    d) Containerfile

  11. What command removes a Docker image?

    a) docker rmi

    b) docker rm

    c) docker remove-image

    d) docker delete

  12. Which Docker object is used to persist data beyond container lifecycle?

    a) Network

    b) Volume

    c) Image

    d) Container

Answer Key

  1. b) Containerizing applications
  2. b) Docker Engine
  3. b) A read-only template for creating containers
  4. b) docker pull
  5. a) docker ps
  6. a) Containers share the host OS kernel, VMs run separate OS
  7. c) Docker Hub
  8. c) docker exec -it <container_id> sh
  9. b) docker stop
  10. a) Dockerfile
  11. a) docker rmi
  12. b) Volume