So, let's start with the most important question
right away.
What exactly is Docker?
Well Docker in the end is a container technology.
It's a tool for creating and managing containers. Okay.
So that's clearly is a nice sentence
but what exactly does it mean?
What's a container in software development
and why might we want to use it?
Well a container in software development
is a standardized unit of software,
which basically means it's a package of code
and that that's important that dependencies
and tools required to run that code.
So for example, if you're building a nodeJS application
nodeJS is a JavaScript run time
which could be used to execute JavaScript code on a server.
If you had such an application
with a container built with Docker,
you could have your applications source code
in that container, as well as the nodeJS runtime
and any other tools that might be needed to run that code.
And the advantages that the same container
with the same nodeJS code
and the same nodeJS tool,
so to the same nodeJS runtime
with always the same version will always
and that's the key thing,
will always give you the exact same behavior and result.
There are no surprises
because it's all baked into the container.
It's always the same.
But maybe it's even easier to understand this concept,
if we take a step back.
Think about a picnic basket.
A picnic basket contains everything you need to have.
Well, a picnic dinner in the park,
something like this, it contains the food
and it contains the dishes which you need.
And therefore you can take that basket
and take it everywhere where you wanna have that picnic
and you're ready to go.
You have it all in that basket.
You can also share that basket with a friend
and that friend can have that same picnic,
you would have had otherwise.
There are no surprises.
You have the dishes and the food.
You don't have to look for dishes
at the place where you wanna eat.
And maybe then you have soup with you
might be strange with a picnic, but whatever.
And then you don't have the dishes for eating soup.
If you pack your own picnic basket, it's all in there
and that's the idea behind the picnic basket.
It's the same idea behind containers and Docker,
which is just a tool for creating
and managing these containers.
Now the a term container might be strange at first,
because if you hear about a container,
you might think about something like this.
At least that is what I know as a container,
but actually it's not a bad comparison.
This is a container we would load onto ships
or trucks to move goods around.
Well, and it's the same idea as with Docker
or containers still.
We have standardized containers here like this
and we can fit various goods into these containers
but they are then self-contained and isolated.
The goods in one container
don't get mixed with goods from another container.
If you need something like cooling,
it can be built into the container.
And therefore the container works standalone
and it can be put onto any ship or any truck,
which is able to handle containers.
And that's exactly the same with Docker containers.
We have our units of software,
our packages with code
and with the dependencies to run this code,
and we can then take it anywhere where Docker runs
and we will then be able to run exactly the same application
with the same environment, wherever that is.
We don't need to worry about installing any extra tools
in that place where we wanna run our application
because it's all in the container.
That is what containers are,
and that is what Docker is about.
Because Docker is just the tool
for building these containers.
Now, the good thing is that support for containers
is built into modern operating systems
or at least there it's easy to get started with them,
and Docker can be installed on all modern operating system
to then work with it there.
And Docker then in the end
is a tool that simplifies the creation
and management process off these containers.
You wouldn't need it to create containers
but it's the de facto standard for doing that
since it makes that task so super simple.