TL;DR
A platform that will host your app (which is deployed as an image) and all its dependencies, which are declared in the dockerfile, the manifest that describes what your app needs to run as well as a lot of other configurations and arguments. Dockerizing your app saves you from the need of installing every single dependency, everywhere you wish to run it. You only need Docker.
What’s so cool with it?
Let’s say you build an awesome app with Node.js, great. Now you want to deploy it and soon enough you realize that you can’t run it because Node.js isn’t installed on the server where you deployed your app. You install it and the app finally runs, yay! Now you try to install it again on another server which also doesn’t have Node.js installed, so you install it again. See where this is going?
Your awesome app has a dependency on Node.js. It could have more; actually, apps usually have multiple dependencies, and all of them need to be present in every environment where your app would run. Docker saves you from having to install all these dependencies everywhere. Docker is the platform that will host your app with all its dependencies, without actually installing anything in the hosting environment. The only thing that needs to be installed is Docker itself. If you have Docker installed, then you deploy your app as an image and declare everything that Docker needs to know in the manifest called .dockerfile.
I won’t get into details, but just to give you an idea of what the dockerfile could look like:
|
|
What’s the catch?
Well, there are a few things:
- You add a layer of complexity, and it makes debugging a bit more tricky.
- Due to bad configuration, apps may behave differently when running on Docker compared to bare-bone running.
Verdict
It’s not easy; it adds some complexity, but the advantage of not having to install dependencies makes it totally worth the pain.