0
0
Dockerdevops~20 mins

Containers vs virtual machines in Docker - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Container Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference in resource usage between containers and VMs

Which statement best describes the difference in resource usage between containers and virtual machines?

AVirtual machines share the host OS kernel and use fewer resources than containers, which run full guest OS instances.
BVirtual machines do not require any resources because they run on the host OS directly.
CContainers and virtual machines use the same amount of resources because both run full guest OS instances.
DContainers share the host OS kernel and use fewer resources than virtual machines, which run full guest OS instances.
Attempts:
2 left
💡 Hint

Think about what runs inside containers versus virtual machines.

💻 Command Output
intermediate
2:00remaining
Output of Docker command showing running containers

What is the output of the command docker ps when no containers are running?

Docker
docker ps
ACONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\nabc123 nginx "/bin/bash" 2 hours ago Up 2 hours 80/tcp webserver
BCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
CError: No containers found
DNo containers running
Attempts:
2 left
💡 Hint

Try running docker ps on a system with no running containers.

🔀 Workflow
advanced
3:00remaining
Steps to migrate an application from VM to container

Which sequence correctly describes the steps to migrate an application from a virtual machine to a Docker container?

A3,2,1,4
B2,1,3,4
C1,2,3,4
D1,3,2,4
Attempts:
2 left
💡 Hint

Think about the logical order from understanding the app to deployment.

Troubleshoot
advanced
2:00remaining
Troubleshooting container networking issues

You have a container running a web server, but you cannot access it from your host machine. Which is the most likely cause?

AThe container port is not published to the host using <code>-p</code> option.
BThe container image is missing the web server software.
CThe Docker daemon is not running on the host.
DThe container is running in privileged mode.
Attempts:
2 left
💡 Hint

Check how ports are exposed from container to host.

Best Practice
expert
2:30remaining
Best practice for container image size optimization

Which practice is best to minimize the size of a Docker container image?

AUse a minimal base image and remove unnecessary files during build.
BInstall all development tools inside the container for flexibility.
CUse multiple layers with large files to speed up builds.
DKeep all logs inside the container to track issues.
Attempts:
2 left
💡 Hint

Think about what makes images large and how to reduce that.