Docker Flashcards

1
Q

What is Docker and why is it useful?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between a virtual machine and a container?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an image?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Dockerfile? How do you write one?

A

A Dockerfile gives instructions on how the image should run the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly