Hello and welcome to this Pluralsight presentation.
My name is Andrew Mallet,
and I'm here as your instructor helping guiding you through the
module Implementing Containers Using Docker.
Now, of course, as we go through this,
we need to know a little bit about what we're going to be looking
at. And we're going to be understanding a little bit more about
containers and what exactly Docker is.
So we'll begin by taking a look at the differences
between containers and virtual machines.
We'll have a look at what Docker offers and what Docker
is, and that's going to include images.
And we can also build Docker images using a Dockerfile. From our
images, we create containers. Containers are runtime instances of
images. To these containers, we can connect volumes, and we can map
ports to make them easily accessible.
Now containers are a great way to isolate applications from the rest
of the operating system and other applications.
A container image itself, the image that is used to make
the container, only needs the absolute resources that are
required to run the application.
There might be a single binary and one or two library
files or something similar to that.
So it's very much smaller than a complete virtual machine, which
is going to host a complete operating system.
When we take a look at what containers offer us,
we have our hardware sitting right at the bottom. On top
of that, we have the operating system.
And obviously, we only need the one operating system. On top of that,
we then have Docker, and Docker runs as a service.
Docker then can start up our containers, and our containers then can
run these isolated container applications. So we can have application
1, application 2, application 3 running.
And in fact, we could have application 3 that might be running a
Java virtual machine based on, let's say, Java 6; whereas maybe
application 4 is a Java application needing the JVM version 8. But
it doesn't matter because their dependencies are completely
isolated from each other.
The containers hold everything that is needed to run their applications.
When we take a look at installing Docker,
we'll be working on our Ubuntu 20.04 system.
We can gain our administrative privileges, and we can go through and check
the network cards that we have. Ip link is just going to show me the
interfaces rather than the network configuration.
When we go through and do our apt update and then an apt install, and it's
docker.io. Don't forget the .io at the end of the package name.
We can go through and check that Docker is up and running.
Running systemctl status as a root user should ensure that we're
able to see any log information for Docker as well.
Again,
we can go through and take a look at our interfaces, and we should see
that we have a new interface. Now we can check then the version of
Docker we've installed, and we can even pull out further information
by using then docker and info.
If we want to take it one step further, we can go through and use docker run.
Docker run is for creating an instance of a container.
We're basing it on the hello‑world image.
We don't have any images at the moment,
so we will pull down the hello‑world image.
The hello‑world image is really, really tiny.
It has exactly one binary and nothing else in it, and it just says Hello World.
So it's a very,
very tiny image, and we'll create then a runtime
instance of that as a container.
So come on. I think we need to check that we can get Docker up and running.