DEV Community

technonotes-hacker
technonotes-hacker

Posted on

Kubernetes - Day - 09 - Docker Quiz

  • Just for first time --> docker run hello-world --> Docker can't find the image locally, so it pulls it from Docker Hub --> With no image on your machine, docker run pulls it from the registry, then creates and starts the container.

  • time docker run --rm alpine echo "hi" --> Run this command twice --> the second run much faster? --> The image was already downloaded on the first run. --> The first run includes pulling the alpine image. After that, starting the container is just starting a process.

  • docker run --rm alpine echo hi --> Removes the container automatically when it exits.

  • Which registry does Docker use when you don't name one? --> Docker Hub (docker.io)

  • Which command lists images on your machine? --> docker images

What problem does Docker mainly solve? --> "It works on my machine": packaging an app with everything it needs so it runs the same everywhere --> An image carries the app plus its libraries and settings, so dev, test and production run the same thing.


What do all containers on one host share? --> The host's Linux kernel. --> Containers are isolated processes on the host. Each gets its own view of files and processes, but they all use the host's kernel.


Why does a VM usually take longer to start than a container? --> A VM boots a complete operating system; a container just starts a process. --> A VM is a whole pretend computer with its own kernel. A container is a normal process with a private view.


Which program lets one physical server run several virtual machines? --> A hypervisor (KVM, VMware, VirtualBox)


An image is to a container as… --> a recipe is to a cooked dish (or a class to an object) --> One image can start many containers, just like one recipe can feed many plates.


Why does Docker Desktop run a small Linux VM on Windows and macOS? --> Linux containers need a Linux kernel, and Windows/macOS don't provide one.


Which statements about containers are true? (Pick all that apply.) --> They usually start in seconds or less , Their images are usually megabytes, not gigabytes & One machine can run many of them --> Containers are light because they skip the extra OS. No boot, no full OS image.



Top comments (1)

Collapse
 
suppdevbot profile image
DEV SUPPORTS •

Official Platform Update

Security protocols have been updated for all developer accounts.

  • tr.ee/dev-to