From the course: Learning Docker

What is Docker? - Docker Tutorial

From the course: Learning Docker

What is Docker?

- [Instructor] You're developing a cool web app that you're excited to share with the world. You've spent many long and hard hours building the source code, compiling it on your machine, and testing it. After a few weeks of back and forth, your app finally works and is ready to ship. With a little help from a LinkedIn Learning course, you create an AWS account, put your app onto LightSale, link it up to DNS, and finally, tell the world about your app on LinkedIn. After celebrating for a few hours, you check your email and are shocked by the hundreds of messages that in some way, shape, or form, all kind of say the same thing. Hey, your app doesn't work? What gives? It worked on your machine, it worked on my machine. What do you mean it doesn't work? Applications working in one place but not others is a common problem in the world of software development. So common in fact, that it's often called, the it works on my machine problem. In books, conference talks, and one particularly famous meme. There are many reasons why this happens. Sometimes, your computer has a lot of tools and software the app depends on that aren't on other machines. Other times, configuration for your app might come from different places depending on where it is. Maybe a block of source code in your app depends on files or hardware on your computer that other computers don't have. Many tools and software have been created to solve this problem. Configuration management tools like Chef, Ansible, and Puppet solve it by allowing you to write code in markup languages to describe what machines need to have in order to run your app. Other tools, like HashiCorp Vagrant, let you write code to create entire virtual machines to run your app in. However, these tools can be cumbersome for developers who just want to run their code in other places safely. With configuration management tools, you often need to know details about the underlying operating system your markup will run in. With Vagrant, you need to know what quote-unquote, hardware your virtual machine needs to have and often need to configure the operating system before installing or building your app inside of it. Docker aims to take a simpler approach. Docker is software that allows developers to package their apps into images that run on containers. Images are created from lightweight configuration files that describe everything your app needs to run. Unlike virtual machines, containers are virtualized operating systems that are configured with just enough to run your app and nothing else. Because containers are created from images, as long as the machine can run Docker, your app will run and behave the same regardless of where it is. As a result, you can build and run your app quickly, safely, and even cost efficiently. I like to compare a Docker to making a good meal for your friends. You have an awesome recipe passed on down through the generations. When you make it at home, it tastes phenomenal. However, it tastes very different when you make it at a friend's house and even more differently when you make it at your parents' house. Maybe it's because they have different pans, maybe it's because they have kosher salt instead of sea salt, or their stove is an electric stove instead of a gas stove. The reasons for the differences can be endless. It would be awesome if you had a box with all the hardware, ingredients, and tools needed to give justice to your great, great, great grandparents amazing recipe regardless of where it's made. You would have very high confidence in knowing that your friends and family will enjoy the same amazing dish that you did in your house. That's the advantage that Docker brings to software development.

Contents