QuizzesWhat is Docker & Why Containers? — Concept Check
intermediate
docker

What is Docker & Why Containers? — Concept Check

Questions on What is Docker & Why Containers?. Docker packages an application and all its dependencies into a lightweight, portable container that runs identically on any machine — solving the classic "works on my machine" problem.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on What is Docker & Why Containers? — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A developer notices that their application works on their local machine but fails in production due to different Java versions. How can Docker help solve this issue?

    • ADocker automatically updates Java versions to match the production environment.
    • BDocker changes the host OS to match the development environment.
    • CDocker uses VMs to replicate the production environment exactly.
    • DDocker containers package the application and its dependencies, ensuring consistency across environments.
  2. 2.You have a Node.js app running in a Docker container. What happens if you change the source code and rebuild the image?

    • AOnly the layers affected by the change are rebuilt, speeding up the process.
    • BDocker automatically updates the running container without rebuilding.
    • CThe Dockerfile is ignored during the rebuild process.
    • DThe entire image is rebuilt from scratch, which is time-consuming.
  3. 3.A team is deciding between using VMs and Docker containers for their application. What is a key advantage of using Docker containers?

    • AContainers require more resources than VMs.
    • BContainers provide better isolation than VMs.
    • CContainers share the host OS kernel, making them lighter and faster than VMs.
    • DContainers can run different OS kernels simultaneously.
  4. 4.A developer runs `docker run -d -p 8080:80 --name my-nginx nginx:1.25`. What does the `-p 8080:80` option do?

    • AIt maps port 8080 on the host to port 80 in the container.
    • BIt restricts the container to use port 80 internally.
    • CIt exposes port 8080 of the container to the internet.
    • DIt sets the container to listen on port 8080 only.
  5. 5.What is the role of a Docker Registry in the container ecosystem?

    • AIt manages the Docker Engine on host machines.
    • BIt stores and distributes Docker images.
    • CIt runs Docker containers on the cloud.
    • DIt provides a GUI for Docker management.
  6. 6.A developer wants to ensure their Docker container starts with a specific command. Which Dockerfile instruction should they use?

    • AEXPOSE
    • BCMD
    • CCOPY
    • DRUN
  7. 7.Why do Docker containers start faster than virtual machines?

    • AContainers run on a separate hardware layer.
    • BContainers use a faster hypervisor than VMs.
    • CContainers pre-load all necessary libraries at startup.
    • DContainers share the host OS kernel, avoiding the overhead of a full OS.
  8. 8.Which Linux kernel feature does Docker use for process isolation?

    • AUnion File System
    • BNamespaces
    • CCgroups
    • DHypervisor