Docker Flashcards
What is Docker and why is it useful?
It allows you to run applications in a “container”. It isolates programs to run with their particular dependencies using docker so you don’t have to worry about versions across different machines and whatnot. Helps build, run, and ship applications.
What is the difference between a virtual machine and a container?
A virtual machine is an isolated environment to run programs. This is resource intensive, though, as it has to create a whole new operating system on your machine. Starting up that OS is also slow. This is like running Windows on a Mac.
A container does something similar, but it is less resource intensive. It runs on the same OS and is quicker to start up. This setup also allows many apps to run in isolation.
Both of these environments have dependencies specific to the program that needs to be run so we don’t need to fiddle around with each individual program when we switch machines. This is what Docker accomplishes.
What is an image?
An image is the file system a container uses to run a program in isolation. That image has all the correct dependencies and whatnot to run the program. When you create an application and upload it to DockerHub, you’re uploading the image so others can use it in their containers. No messing with dependencies and whatnot.
What is a Dockerfile? How do you write one?
A Dockerfile gives instructions on how the image should run the program.