shouldenough

DevOpsLearn Docker by Dockerizing Your App

Lesson 1 of 10

Lesson 01/5 minutes/1 graded

What Docker is, and why it exists

It runs fine on your computer but breaks on your colleague's. Why that happens, what it costs on the server, and what Docker changes about it.

What is Docker?

Docker is a tool (virtualization software) that makes developing and deploying applications much easier. Think of a packed briefcase: your code, its libraries, the runtime, the configuration, all in one package. That package is an image, and when you run it you get a container. We will learn more about images and containers later on in this course.

Why Docker exists and the problems it solves

Imagine you are building an application using the language or framework of your choice, and it runs perfectly on your computer. Now your friend or colleague wants to run it on their computer, so they install and set up everything the application needs. Maybe they end up with a different version, maybe a different setting. What runs fine on your computer doesn't run on theirs. You've probably heard the phrase: "But it works on my machine."

Now think of that with a team of 10 developers. Then do it again on the server, which is just another computer. Keeping everything the same gets hard fast: one small mistake or one version mismatch can cause big problems.

Development process

Before DockerWith Docker
Install and set up everything the application needs on your computer.Run everything the application needs in containers.
Different versions, settings or operating systems cause problems.The same setup runs on Windows, macOS and Linux.
A lot of manual setup, and one missed step breaks it.Less setup, and no more "it works on my machine".

Deployment process

Before DockerWith Docker
Install and set up the application and its requirements on the server.Package the application and everything it needs into one image.
Different server setups cause version and setting problems.The server runs the same image you built and tested.
A small mistake during setup can break the application.The setup is already inside the image, so one command starts it.

Docker standardizes how software runs: you define the environment once and reuse it everywhere. Less time on setup, more on building. If it runs on your computer, it runs the same way on a server, which is where the Docker workflow picks up.

Interview questions

These four come up in almost every Docker interview, and everything you need to answer them is above.

Knowledge check4 questions
Question 1 of 4
What is Docker?