WEBVTT

00:00:00.120 --> 00:00:08.800
Hello welcome to another
containers channel episode.

00:00:08.800 --> 00:00:12.580
I'm Matt McSpirit, technical
evangelist for all of our data

00:00:12.580 --> 00:00:15.640
center technology, and this is
part two in a little miniseries

00:00:15.640 --> 00:00:18.450
we've got going on,
on containers fundamentals.

00:00:18.450 --> 00:00:21.200
In the first episode of this
miniseries we talked a little

00:00:21.200 --> 00:00:24.770
bit about some of the key
concepts around images, around

00:00:24.770 --> 00:00:28.490
networking, around building
a container, we run a container.

00:00:28.490 --> 00:00:29.830
We look to some of
the architectural

00:00:29.830 --> 00:00:32.380
differences between
containers and VM's.

00:00:32.380 --> 00:00:35.130
And in this episode I'm pleased
to be joined by Neil Peterson

00:00:35.130 --> 00:00:38.940
again to help us understand
a little bit more depth, or

00:00:38.940 --> 00:00:42.930
should I say, quite a bit more
depth this time on images

00:00:42.930 --> 00:00:45.410
networking and portability.

00:00:45.410 --> 00:00:48.740
So Neil take us through some of
the key things we need to know

00:00:48.740 --> 00:00:51.390
while writing professionals, and
developers need to know around

00:00:51.390 --> 00:00:53.890
some of the images,
networking and portability.

00:00:53.890 --> 00:00:56.780
>> Sure so what I'm gonna do in
this session is really we're

00:00:56.780 --> 00:01:00.890
gonna build an application
on my laptop.

00:01:00.890 --> 00:01:03.690
We're then gonna
take th container

00:01:03.690 --> 00:01:07.720
image from that application,
throw it up in Docker hub, and

00:01:07.720 --> 00:01:10.960
then pull into a container
host running in Azure.

00:01:10.960 --> 00:01:15.360
Through this process we're
gonna dig into image layering.

00:01:15.360 --> 00:01:16.770
We're gonna talk
about networking, and

00:01:16.770 --> 00:01:18.680
then we've got that
portability piece.

00:01:18.680 --> 00:01:20.970
We're gonna take a look
at Docker help, and

00:01:20.970 --> 00:01:22.790
how we can use that to
move images around.

00:01:22.790 --> 00:01:25.350
>> Yeah, cuz it's not quite
a copy and paste type operation.

00:01:25.350 --> 00:01:26.570
There's a little bit more to it.

00:01:26.570 --> 00:01:29.840
Okay, so, this is a bit of
a recap from the last session.

00:01:29.840 --> 00:01:31.970
Hopefully, you watched
the previous episode.

00:01:31.970 --> 00:01:33.270
We did cover some of
this content, but

00:01:33.270 --> 00:01:34.660
just bring people
up to speed for

00:01:34.660 --> 00:01:37.570
those that haven't
Images in general.

00:01:37.570 --> 00:01:40.310
>> Yeah, so, the first thing
we're gonna look at is images

00:01:40.310 --> 00:01:43.860
and image layering, and
just to recap, a container image

00:01:45.290 --> 00:01:47.700
contains the application,
it contains dependencies.

00:01:47.700 --> 00:01:50.500
So, it's basically
the unit that we use

00:01:50.500 --> 00:01:52.060
to derive containers from.

00:01:52.060 --> 00:01:55.150
So when I want to build
a container I basically so

00:01:55.150 --> 00:01:59.020
hey build a container from that
image, boom and away it goes.

00:01:59.020 --> 00:01:59.530
>> Okay.

00:01:59.530 --> 00:02:03.180
>> One of the, concepts in,
imaging it's pretty cool and

00:02:03.180 --> 00:02:08.140
it, differs quite a bit from,
how we use images with

00:02:08.140 --> 00:02:11.970
virtual machines is this
concept of image layering.

00:02:11.970 --> 00:02:16.520
And what I mean is we start
with a base OS image, so

00:02:16.520 --> 00:02:19.280
that might be
Windows server core.

00:02:19.280 --> 00:02:21.450
We've got an image for Windows
server core then we might make

00:02:21.450 --> 00:02:24.630
some modifications to that
image, install some software and

00:02:24.630 --> 00:02:27.550
then capture that
into a new image.

00:02:27.550 --> 00:02:31.400
Well we're not actually creating
a new complete image that

00:02:31.400 --> 00:02:34.610
includes Windows server core
in that new application.

00:02:34.610 --> 00:02:37.270
We're actually just creating
an image of the deltas.

00:02:37.270 --> 00:02:38.270
>> Yep.
So it changes.

00:02:38.270 --> 00:02:39.880
>> Just the changes, and

00:02:39.880 --> 00:02:44.670
when we want to go deploy that
application, what ends up

00:02:44.670 --> 00:02:48.210
happening is the container uses
>> Both of the layers.

00:02:48.210 --> 00:02:51.220
It uses the base OS image and
the changes.

00:02:51.220 --> 00:02:51.730
>> Right.
>> And

00:02:51.730 --> 00:02:55.330
then any other container that we
bring up on that host that also

00:02:55.330 --> 00:02:59.990
uses any of the common layers,
we don't have to spin up a new

00:02:59.990 --> 00:03:01.710
instance of that
container image.

00:03:01.710 --> 00:03:03.810
They just share what's
already in place.

00:03:03.810 --> 00:03:06.240
So we can look at
this in a document or

00:03:06.240 --> 00:03:09.000
a on the PowerPoint here,
and a graphic here.

00:03:09.000 --> 00:03:12.450
So picture here depicts
a container host and

00:03:12.450 --> 00:03:14.480
the container host could
be a physical machine,

00:03:14.480 --> 00:03:15.480
it could be a virtual machine?

00:03:15.480 --> 00:03:15.980
>> Absolutely,
>> Right?

00:03:15.980 --> 00:03:16.840
>> A virtual machine, so

00:03:16.840 --> 00:03:19.260
most of the demonstrations
that we're going to see here.

00:03:19.260 --> 00:03:19.880
I've got a Linux

00:03:19.880 --> 00:03:21.930
system running on
Hyper-V on my laptop.

00:03:21.930 --> 00:03:23.500
>> Mmhm
>> We'll also see a virtual

00:03:23.500 --> 00:03:25.840
machine running in Azure
at a later point okay.

00:03:25.840 --> 00:03:28.930
So kind of walking
through this scenario,

00:03:28.930 --> 00:03:31.180
I might deploy
the base OS image.

00:03:31.180 --> 00:03:32.460
>> And for
people who are not familiar,

00:03:32.460 --> 00:03:34.150
where do you get
that Base OS image?

00:03:34.150 --> 00:03:36.040
I mean is it,
do you start with it.

00:03:36.040 --> 00:03:37.310
Is it on the machine,

00:03:37.310 --> 00:03:39.300
might it contain the [INAUDIBLE]
on the [INAUDIBLE] machine?

00:03:39.300 --> 00:03:40.830
Does it have the Base Os
image there?

00:03:40.830 --> 00:03:43.430
Do I have to grab it and
what about Windows?

00:03:43.430 --> 00:03:47.170
So, if we're working with our
Linux host we can grab these

00:03:47.170 --> 00:03:50.920
images from Docker Hub or
other registries.

00:03:50.920 --> 00:03:53.460
And right now in the technical
preview of windows server

00:03:53.460 --> 00:03:54.130
containers.

00:03:55.680 --> 00:03:58.700
We position that base
OS image for you, so

00:03:58.700 --> 00:04:01.330
we position the Windows Server
core base OS images.

00:04:01.330 --> 00:04:02.770
So if you go through the docs,

00:04:02.770 --> 00:04:05.420
it walks through a procedure of
setting up the Windows Server.

00:04:05.420 --> 00:04:07.117
You can download [CROSSTALK]
>> Yep, and

00:04:07.117 --> 00:04:08.170
it will be there for you.

00:04:08.170 --> 00:04:11.280
So I might deploy this
base OS image and

00:04:11.280 --> 00:04:12.950
then install some
software into it.

00:04:12.950 --> 00:04:16.680
So let's maybe, just for
example, a web application.

00:04:18.070 --> 00:04:21.340
And then I capture that out
to its own container image.

00:04:21.340 --> 00:04:26.020
I then may redeploy that
web server image and

00:04:26.020 --> 00:04:29.200
deploy an application in it,
and then redeploy it again and

00:04:29.200 --> 00:04:30.410
deploy another application.

00:04:30.410 --> 00:04:34.480
So, I've got two container
images, each containing their

00:04:34.480 --> 00:04:38.550
own applications, but they have
a common web server image and

00:04:38.550 --> 00:04:40.740
a common base OS image.

00:04:40.740 --> 00:04:43.520
>> Those App 1 Image and
App 2 Image on the graphic here

00:04:43.520 --> 00:04:45.360
take a dependency on
Web Server Image,

00:04:45.360 --> 00:04:47.340
which itself takes
a dependency on Base.

00:04:47.340 --> 00:04:48.830
>> Yep.
>> And if you did a,

00:04:48.830 --> 00:04:51.430
tell me what images are on the
system view, on this container,

00:04:51.430 --> 00:04:52.990
you would see four
at this point.

00:04:52.990 --> 00:04:54.930
>> Yep, absolutely,
you'd see four.

00:04:54.930 --> 00:04:56.180
>> Okay.
>> We'll take a look at that.

00:04:56.180 --> 00:04:58.740
We'll actually take a look at
the dependencies between them.

00:04:58.740 --> 00:04:59.460
>> Okay, great.

00:04:59.460 --> 00:05:02.680
>> Then, in my container host,
if I was to then take my app

00:05:02.680 --> 00:05:04.770
one image,
>> And deploy it,

00:05:05.930 --> 00:05:07.360
I'd have a running container,
>> Yep.

00:05:07.360 --> 00:05:08.380
>> With App 1.

00:05:08.380 --> 00:05:12.495
And that container would be
comprised of these three images.

00:05:12.495 --> 00:05:13.000
>> Mm-hm.

00:05:13.000 --> 00:05:16.380
>> If I were to then deploy
a container from App Image 2,

00:05:16.380 --> 00:05:19.730
I now have a running container with

00:05:19.730 --> 00:05:21.780
>> App two, you can see it

00:05:21.780 --> 00:05:26.195
shares the common web server
image and base OS image.

00:05:26.195 --> 00:05:27.020
>> Right.

00:05:27.020 --> 00:05:27.990
>> Container images,

00:05:27.990 --> 00:05:32.540
so it may literally share
the instances of those images.

00:05:32.540 --> 00:05:36.960
Footprint stays down, container
spin up time has increased.

00:05:36.960 --> 00:05:39.160
>> And use of resources
is very efficient.

00:05:39.160 --> 00:05:40.070
>> Yep, absolutely.

00:05:40.070 --> 00:05:40.950
>> Okay.

00:05:40.950 --> 00:05:42.140
>> So let's contain our
image layering, and

00:05:42.140 --> 00:05:43.980
we'll take a look at
that in demonstration.

00:05:43.980 --> 00:05:49.050
And again, one of my goals here
was to kind of point out some of

00:05:49.050 --> 00:05:52.310
the differences between working
with a virtual machine, on

00:05:52.310 --> 00:05:58.010
a long time system center, kind
of Data center management type,

00:05:58.010 --> 00:06:01.630
so deploying virtual machines
from images is something-

00:06:01.630 --> 00:06:02.180
>> And templates.

00:06:02.180 --> 00:06:03.780
>> Yeah, it's something
I did quite a bit.

00:06:03.780 --> 00:06:05.410
It changes quite a bit here.

00:06:05.410 --> 00:06:09.110
The second thing that's
different in working with

00:06:09.110 --> 00:06:12.790
containers from VMs potentially
is the way we do networking

00:06:13.850 --> 00:06:15.250
with our containers.

00:06:15.250 --> 00:06:17.240
So when you think about
a virtual machine or

00:06:17.240 --> 00:06:19.070
a virtual machine host.

00:06:19.070 --> 00:06:21.340
I'm gonna put a bunch of
different VMs on this host but

00:06:21.340 --> 00:06:24.080
each one of those VMs is
gonna have an IP address.

00:06:24.080 --> 00:06:27.240
I really don't manage
them any differently.

00:06:27.240 --> 00:06:30.290
>> Right, so Nick and
that Nick has his on Mac.

00:06:30.290 --> 00:06:31.900
>> Exactly,
>> Just like a physical system.

00:06:31.900 --> 00:06:32.420
>> Exactly.

00:06:32.420 --> 00:06:34.790
If I need to access a resource.

00:06:34.790 --> 00:06:39.400
That's being hosted in that VM,
I just go to the VM,

00:06:40.490 --> 00:06:42.740
as seen in the image here.

00:06:42.740 --> 00:06:46.300
So how this differs is, because
we've got this large density

00:06:47.840 --> 00:06:50.900
capability, this large density
capability with containers.

00:06:50.900 --> 00:06:55.070
I can literally have potentially
thousands of these things

00:06:55.070 --> 00:06:59.190
on one host, rather than
giving each one of them

00:06:59.190 --> 00:07:03.540
a publicly accessible
IP address.

00:07:03.540 --> 00:07:07.450
Something that's common to
do is rather put them behind

00:07:09.150 --> 00:07:12.120
network address translation.

00:07:12.120 --> 00:07:16.030
So my host might have an IP
address that's publicly

00:07:16.030 --> 00:07:21.400
available however my container
has a non routeable IP address.

00:07:21.400 --> 00:07:25.370
And when I want to access
the application in my container,

00:07:25.370 --> 00:07:27.930
rather than referencing
that IP address, or

00:07:27.930 --> 00:07:31.950
that net bias name
associated that IP address.

00:07:31.950 --> 00:07:36.430
Rather, I'm going to
access the host and

00:07:36.430 --> 00:07:38.400
we'll build some port mapping,
>> Yeah.

00:07:38.400 --> 00:07:40.910
>> Between the external
port on the host and

00:07:40.910 --> 00:07:42.910
the internal port on
the container application.

00:07:42.910 --> 00:07:43.690
>> I see.
>> And what

00:07:43.690 --> 00:07:46.270
this allows me to do is if you
think about it, I might have

00:07:46.270 --> 00:07:49.140
a container host that's running
>> Three hundred

00:07:49.140 --> 00:07:53.270
web applications all serving
content on port eighty.

00:07:53.270 --> 00:07:56.410
Well if I hit the container
host on port eighty,

00:07:56.410 --> 00:07:59.410
you know it needs to know
how to route that request.

00:07:59.410 --> 00:08:01.230
>> Yeah.
>> So we'll do these mappings.

00:08:01.230 --> 00:08:05.170
I might do like Port 80 to port
80 and port 82 to port 60 and

00:08:05.170 --> 00:08:06.580
port 83 to port 80.

00:08:06.580 --> 00:08:07.120
>> Yeah.

00:08:07.120 --> 00:08:09.060
>> And we'll see that in
demonstration as well.

00:08:09.060 --> 00:08:10.380
>> Nice, so it's important
to call that as well,

00:08:10.380 --> 00:08:13.550
you've described a net
which will be common

00:08:13.550 --> 00:08:18.340
to a lot of people but DHCP
can also be used [INAUDIBLE]

00:08:18.340 --> 00:08:20.470
it's not just a net
only solution.

00:08:20.470 --> 00:08:21.720
>> Yup, absolutely,
so if you're.

00:08:21.720 --> 00:08:22.670
>> You're an enterprise.

00:08:22.670 --> 00:08:24.960
>> DHCP can be used
within the containers.

00:08:26.480 --> 00:08:29.400
What I'm finding that the NAT is
the more common scenario though.

00:08:29.400 --> 00:08:30.820
>> Right,
okay interesting, great.

00:08:32.560 --> 00:08:34.270
>> And then finally the last
thing we're gonna look here is

00:08:34.270 --> 00:08:35.270
the container registry and

00:08:35.270 --> 00:08:37.010
we've talked about this
quite a bit already.

00:08:37.010 --> 00:08:39.530
We'll look at Docker Hub,
a publicly available registry,

00:08:39.530 --> 00:08:41.660
where we can take these
container images,

00:08:41.660 --> 00:08:45.000
put them up in the registry and
pull them down somewhere else or

00:08:45.000 --> 00:08:46.160
on another container host.

00:08:46.160 --> 00:08:46.950
>> Nice.
Okay.

00:08:46.950 --> 00:08:49.950
So, I guess now it's time for
take a look at the technology.

00:08:49.950 --> 00:08:50.650
>> Yep.
So let's jump into

00:08:50.650 --> 00:08:51.620
the demonstration.

00:08:52.620 --> 00:08:53.280
>> I say let's do it,

00:08:53.280 --> 00:08:57.470
it's you doing it but
I claim some, I'm still here.

00:08:57.470 --> 00:08:58.710
>> Sure.
So first thing I'm going to do

00:08:58.710 --> 00:09:02.680
is just now, we're gonna take a
look at the image layering here.

00:09:02.680 --> 00:09:06.110
So, I'm gonna start by creating
a container with Ubuntu

00:09:06.110 --> 00:09:07.472
base OS image.

00:09:07.472 --> 00:09:11.659
So, same command
Commands we used in

00:09:11.659 --> 00:09:16.937
the previous video,
docker run -it ubuntu.

00:09:16.937 --> 00:09:20.373
>> -it being interactive, which
means it starts straightaway and

00:09:20.373 --> 00:09:22.380
you're into the,
in this case Bash.

00:09:22.380 --> 00:09:24.500
>> I'm in the container
in Bash right now.

00:09:24.500 --> 00:09:27.290
>> So it's kind of like if you
were on a Windows machine and

00:09:27.290 --> 00:09:29.870
you had something set to
start up automatically.

00:09:29.870 --> 00:09:32.058
As soon as the machine
kicks off,

00:09:32.058 --> 00:09:32.936
[CROSSTALK]
>> You're

00:09:32.936 --> 00:09:33.540
choosing what you wanna use.

00:09:33.540 --> 00:09:36.000
>> Yeah, we're telling it what
process to run once we jump

00:09:36.000 --> 00:09:36.620
into the container.

00:09:36.620 --> 00:09:38.560
>> And if this was
a non-interactive session and

00:09:38.560 --> 00:09:39.580
it was gonna be a web server,

00:09:39.580 --> 00:09:42.510
you'd just want the web server
services to start straightaway.

00:09:42.510 --> 00:09:43.790
>> Yep, and
we'll see an example of that.

00:09:43.790 --> 00:09:44.680
>> Okay, great.

00:09:44.680 --> 00:09:47.088
>> All right, so inside of this
container I'm gonna go ahead and

00:09:47.088 --> 00:09:48.073
install some software.

00:09:50.678 --> 00:09:53.610
I'm actually gonna
update app-git just to

00:09:53.610 --> 00:09:57.739
give it a new list of references
and software to be installed.

00:09:57.739 --> 00:10:00.441
>> So let's hope it's not a full
on Linux update build and

00:10:00.441 --> 00:10:02.633
everything for
the full OS and everything.

00:10:02.633 --> 00:10:03.492
>> It should be pretty quick.

00:10:03.492 --> 00:10:05.512
>> There we go.

00:10:05.512 --> 00:10:06.026
And so,

00:10:06.026 --> 00:10:09.702
once this is done, I'm gonna
install a piece of software.

00:10:09.702 --> 00:10:13.558
Capture that off into a new
container image, and then what

00:10:13.558 --> 00:10:17.412
we'll do is, we'll actually
look at the Ubuntu image and

00:10:17.412 --> 00:10:20.890
look at my new image, and
kind of see how they merge.

00:10:20.890 --> 00:10:22.565
We'll see that
overlap in layering.

00:10:22.565 --> 00:10:24.560
And then we'll continue to
build on top of that and

00:10:24.560 --> 00:10:26.400
we'll likely build
an application into it.

00:10:26.400 --> 00:10:29.060
>> Those updates you just done,
they haven't updated the base.

00:10:29.060 --> 00:10:30.525
>> No.
>> They've updated your running

00:10:30.525 --> 00:10:32.090
instance from that base.

00:10:32.090 --> 00:10:34.120
>> Yeah, so those updates have
been written into that scratch

00:10:34.120 --> 00:10:35.970
space, which will
then become part of

00:10:35.970 --> 00:10:37.310
the new image that
we're gonna create.

00:10:37.310 --> 00:10:39.729
>> But, anybody deploying a new
container from the base wouldn't

00:10:39.729 --> 00:10:41.138
get your updates
you've just done.

00:10:41.138 --> 00:10:43.030
>> Exactly.

00:10:43.030 --> 00:10:47.040
So, apt-get install nano.

00:10:47.040 --> 00:10:49.750
And again, this is just
another text editor.

00:10:49.750 --> 00:10:52.860
All right, so that's done.

00:10:52.860 --> 00:10:56.650
So, inside of the container,
I can run nano.

00:10:56.650 --> 00:10:59.676
So I'm gonna exit, and now I'll
exit out of the container.

00:11:04.571 --> 00:11:08.830
And here is the container which
we just created, elegant curry.

00:11:08.830 --> 00:11:10.300
>> Nice.

00:11:10.300 --> 00:11:11.360
>> So I'm gonna do Dr. Commit.

00:11:11.360 --> 00:11:14.520
>> I should use this kind of
approach to figure out my

00:11:14.520 --> 00:11:17.270
gamer tagging feature for
Xbox and I really struggle.

00:11:17.270 --> 00:11:20.633
>> All right Dr. Commit demo.

00:11:23.370 --> 00:11:24.680
And so,
if we look at Docker images,

00:11:24.680 --> 00:11:27.480
we can see that I have
a new image demo.

00:11:28.650 --> 00:11:33.200
So let's actually take a look
there at kind of the overlapping

00:11:33.200 --> 00:11:35.970
between the base OS image and
what we just created.

00:11:35.970 --> 00:11:37.680
So, I'm gonna run
a command Docker history.

00:11:40.230 --> 00:11:47.903
And, Give it the name of
the container we just,

00:11:47.903 --> 00:11:50.300
or the container image
that we just created.

00:11:50.300 --> 00:11:54.500
And also do the same thing And
run Ubuntu.

00:11:54.500 --> 00:11:57.660
So you can see here that
the Ubuntu image is comprised of

00:11:57.660 --> 00:11:59.360
four layers.

00:11:59.360 --> 00:12:03.410
So every time it was updated,
a new layer was created and

00:12:03.410 --> 00:12:07.150
that official image that was
available on the docker hub

00:12:07.150 --> 00:12:09.670
registry comprised of
these four images.

00:12:09.670 --> 00:12:10.980
>> That's not
something you've done.

00:12:10.980 --> 00:12:11.970
>> That's not
something I've done.

00:12:11.970 --> 00:12:15.850
That all came when I pulled that
image down from docker hub.

00:12:15.850 --> 00:12:16.640
>> Right, okay.

00:12:16.640 --> 00:12:19.070
But notice here that

00:12:20.650 --> 00:12:24.690
the demo image I just created
is comprised of five layers.

00:12:24.690 --> 00:12:26.980
>> Right.
>> And if we actually look here,

00:12:26.980 --> 00:12:30.510
the top layer on
Ooboontoo ends in 498.

00:12:30.510 --> 00:12:34.100
Well the fourth layer
up on my image.

00:12:34.100 --> 00:12:38.190
Ends in 498, so
the changes that I made

00:12:38.190 --> 00:12:42.740
are represented by
this layer right here.

00:12:42.740 --> 00:12:45.300
>> Even though you're, even
though you've essentially got

00:12:45.300 --> 00:12:47.900
two separate images, you've
got yours that you've just

00:12:47.900 --> 00:12:49.260
essentially are in
the process of creating.

00:12:49.260 --> 00:12:52.290
>> So I manage them as two
separate images, yeah exactly.

00:12:52.290 --> 00:12:55.810
And the The Docker engine
takes care of kind of the,

00:12:55.810 --> 00:12:56.810
>> Stitching all together.

00:12:56.810 --> 00:12:58.190
>> Yeah,
stitching them all together.

00:12:58.190 --> 00:13:00.830
Yeah, I may just deploy a demo,
but

00:13:00.830 --> 00:13:03.650
it's gonna go ahead and
make sure that all of these

00:13:03.650 --> 00:13:07.110
layers are positioned
where they need to be.

00:13:07.110 --> 00:13:10.290
You can actually see here, and
we actually installed software

00:13:10.290 --> 00:13:13.670
And our layer, and you can see
that the size of the image

00:13:13.670 --> 00:13:16.070
changed as well as we put
that software in there.

00:13:16.070 --> 00:13:18.490
So that's just kind of
a demonstration about how that

00:13:18.490 --> 00:13:20.810
layering works, and
you can use this for

00:13:20.810 --> 00:13:22.728
troubleshooting purposes and
whatnot as your.

00:13:22.728 --> 00:13:23.335
>> See what [CROSSTALK]
>> changes

00:13:23.335 --> 00:13:24.842
>> Have been made in the past.

00:13:24.842 --> 00:13:26.500
>> Yeah, and you can
actually go, I maybe wanna

00:13:26.500 --> 00:13:27.660
>> Launching of a container

00:13:27.660 --> 00:13:30.330
using one of the middle
images just to see kind of

00:13:30.330 --> 00:13:33.040
what that layer looks like
when running in a container.

00:13:33.040 --> 00:13:34.840
>> It's almost like
a version control.

00:13:34.840 --> 00:13:37.030
>> Absolutely.
>> In a way cuz you saw it.

00:13:37.030 --> 00:13:39.240
I'm thinking if I was on
a SharePoint side and

00:13:39.240 --> 00:13:41.330
I made change to a document,
I can always go back and

00:13:41.330 --> 00:13:42.830
look about previous.

00:13:42.830 --> 00:13:45.390
Just to make changes and so
we can where it change, Page.

00:13:45.390 --> 00:13:46.700
>> Or if my application broke,

00:13:46.700 --> 00:13:48.400
maybe I wanna go back to
the previous image and

00:13:48.400 --> 00:13:49.710
just kind of see what's
going on in there.

00:13:49.710 --> 00:13:51.210
>> Yup.
>> And just get my hands on,

00:13:51.210 --> 00:13:51.940
so definitely.

00:13:51.940 --> 00:13:53.070
>> Okay, all right.

00:13:53.070 --> 00:13:56.085
>> All right, so let's
expand on that a little bit.

00:13:56.085 --> 00:13:57.780
> Do we know how long
this list could be?

00:13:58.830 --> 00:13:59.680
Is there.

00:13:59.680 --> 00:14:01.710
>> I don't know,
I don't know how long it can be,

00:14:01.710 --> 00:14:06.680
but definitely when you get into
the procedure of building images

00:14:06.680 --> 00:14:09.380
you can definitely,
there's strategy.

00:14:09.380 --> 00:14:12.598
For making sure that your images
are concise and there's strategy

00:14:12.598 --> 00:14:15.116
for managing [CROSSTALK]
>> You don't have to go through

00:14:15.116 --> 00:14:16.309
thousands of history for

00:14:16.309 --> 00:14:18.230
every individual change but-
>> Yeah, and

00:14:18.230 --> 00:14:20.050
we'll touch on a little
bit of that here but

00:14:20.050 --> 00:14:22.700
there's definitely, I mean
there's articles out there

00:14:22.700 --> 00:14:26.920
about proper image creation and
proper image management.

00:14:26.920 --> 00:14:28.450
Definitely worth reading.

00:14:28.450 --> 00:14:29.910
>> Okay, nice.

00:14:29.910 --> 00:14:34.420
All right, so we took a base
image, we created a new image,

00:14:34.420 --> 00:14:35.740
installed some software unto it.

00:14:35.740 --> 00:14:38.080
Let's expand on that
a little bit and

00:14:38.080 --> 00:14:40.350
start to build
an application out of it.

00:14:40.350 --> 00:14:44.932
So, I am going to,
let me switch some folders here

00:15:00.597 --> 00:15:05.564
So what we're gonna do
is create a new image.

00:15:05.564 --> 00:15:07.906
We're gonna drive it from that
image that we just created, and

00:15:07.906 --> 00:15:10.170
we're actually gonna put some
web server software into it.

00:15:10.170 --> 00:15:10.740
>> Right.

00:15:10.740 --> 00:15:14.800
>> Now up to this point we've
been manually creating images.

00:15:14.800 --> 00:15:17.850
So I deploy the container,
I jump into it,

00:15:17.850 --> 00:15:19.990
I make a modification,
I get out of it,

00:15:19.990 --> 00:15:23.130
and then I capture
that To an image.

00:15:23.130 --> 00:15:24.370
>> Yeah.

00:15:24.370 --> 00:15:26.990
>> Docker has a procedure
that we can use to

00:15:26.990 --> 00:15:29.150
automate this using something
called a docker file.

00:15:29.150 --> 00:15:29.710
>> Right.

00:15:29.710 --> 00:15:32.200
>> And in the docker
file really we're jus

00:15:32.200 --> 00:15:33.550
writing those instructions.

00:15:33.550 --> 00:15:34.920
And we're saying hey.

00:15:34.920 --> 00:15:39.560
Create a container, run these
commands when you're done

00:15:39.560 --> 00:15:41.520
capture that out
into it's own image.

00:15:41.520 --> 00:15:43.150
So it's just an automated
way of creating images.

00:15:43.150 --> 00:15:45.580
>> It's like a little back file
essentially to do something.

00:15:45.580 --> 00:15:46.260
>> Pretty much.

00:15:46.260 --> 00:15:47.920
>> Right, okay.
>> So here's an example of one,

00:15:47.920 --> 00:15:50.140
and you can see this
first line from demo.

00:15:50.140 --> 00:15:54.480
What I'm saying is go take my
demo Image, the image that we

00:15:54.480 --> 00:15:58.960
just created and run all of
these commands against it.

00:15:58.960 --> 00:16:02.030
>> To clarify before you carry
on, you've done this already,

00:16:02.030 --> 00:16:02.740
this isn't.

00:16:02.740 --> 00:16:03.360
>> Yes.

00:16:03.360 --> 00:16:05.470
>> This isn't something that's
been generated based on

00:16:05.470 --> 00:16:07.080
your environment
up to this point.

00:16:07.080 --> 00:16:09.840
>> Yes, good call this just a
text file that I just built out,

00:16:09.840 --> 00:16:11.645
prior to [INAUDIBLE]
>> So, you've written this.

00:16:11.645 --> 00:16:12.400
>> Yep.
>> Okay, great.

00:16:12.400 --> 00:16:16.130
Yep, so just some
metadata maintainer and

00:16:16.130 --> 00:16:19.050
then run app get install nginx.

00:16:19.050 --> 00:16:21.900
So basically what I'm
saying is spin up

00:16:21.900 --> 00:16:23.858
a container from the image demo.

00:16:23.858 --> 00:16:24.752
>> Mm-hm.

00:16:24.752 --> 00:16:26.540
>> Install nginx.

00:16:26.540 --> 00:16:27.370
>> Check for any updates for.

00:16:27.370 --> 00:16:29.810
>> Yeah, actually I actually
commented that out.

00:16:29.810 --> 00:16:31.530
>> Cuz if you recall-
>> We did it already.

00:16:31.530 --> 00:16:35.370
>> We did it already when
we created the image.

00:16:35.370 --> 00:16:38.700
Expose port 80,
set a working directory, and

00:16:38.700 --> 00:16:43.270
then set a command to run every
time we start a container

00:16:43.270 --> 00:16:44.230
from this image.

00:16:44.230 --> 00:16:45.340
So I'm basically saying, hey,

00:16:45.340 --> 00:16:48.180
when this fires up,
start engine x.

00:16:48.180 --> 00:16:50.494
If you have enough
comments in there now,

00:16:50.494 --> 00:16:53.940
in the will that slow
down the speed of

00:16:53.940 --> 00:16:56.630
the image creation overall
because obviously, it's gotta go

00:16:56.630 --> 00:16:58.950
through that big process
that didn't take long, but

00:16:58.950 --> 00:17:03.210
it was 30 seconds of downloads
there, may be bigger in future.

00:17:03.210 --> 00:17:05.840
>> Yeah, in this case,
it would have actually run that

00:17:05.840 --> 00:17:08.650
process again, and it would have
taken a little bit more time.

00:17:08.650 --> 00:17:10.910
And actually, it does
a couple more things as well.

00:17:10.910 --> 00:17:14.800
As we'll see, So for
every line in a docker file,

00:17:14.800 --> 00:17:17.350
links are created
a new image for

00:17:17.350 --> 00:17:19.950
each thing that occurs
within the doctor file.

00:17:19.950 --> 00:17:21.360
>> Okay.

00:17:21.360 --> 00:17:23.640
>> So, we'll see an example
of that here in a second.

00:17:23.640 --> 00:17:24.190
>> Good. Okay. Great.

00:17:24.190 --> 00:17:26.640
>> So, let me exit out of this.

00:17:26.640 --> 00:17:29.560
And so, instead of having
to create a container,

00:17:29.560 --> 00:17:31.090
manually make this changes and

00:17:31.090 --> 00:17:35.298
capture out with a docker file,
i'll just do docker,

00:17:35.298 --> 00:17:40.290
Build dash T,
>> What does the T mean?

00:17:40.290 --> 00:17:43.080
>> Just allows me to
give the image a name.

00:17:43.080 --> 00:17:44.400
>> Right.
>> If I didn't give a dash T,

00:17:44.400 --> 00:17:46.520
it would just auto
generate a name or

00:17:46.520 --> 00:17:48.090
actually I think it
gives it no name.

00:17:48.090 --> 00:17:48.590
>> Right.

00:17:50.540 --> 00:17:52.870
So this will be your image name
that you will specify in there?

00:17:52.870 --> 00:17:54.200
>> Yep.

00:17:54.200 --> 00:17:58.320
Demonginx, and
just a period to say hey,

00:17:58.320 --> 00:18:01.060
grab the docker file from the
folder that we're working in.

00:18:01.060 --> 00:18:01.560
>> Yeah.

00:18:03.637 --> 00:18:05.290
>> And so, hands off.

00:18:05.290 --> 00:18:06.030
It's gonna go ahead and

00:18:06.030 --> 00:18:07.980
do all the work that I
would've done manually.

00:18:07.980 --> 00:18:10.890
>> Nice.
>> And this is important.

00:18:10.890 --> 00:18:13.490
This allows us,
when we think of things like

00:18:13.490 --> 00:18:15.630
Statements like
infrastructure as code,

00:18:15.630 --> 00:18:17.900
I mean that's what we
have going on here.

00:18:17.900 --> 00:18:21.960
So if I wanted to like rebuild
this image on a particular

00:18:21.960 --> 00:18:26.350
cadence, you know, rather than
manually doing all this work,

00:18:26.350 --> 00:18:31.160
I've got this code that defines
The contents of my image, and

00:18:31.160 --> 00:18:32.700
I can just rerun this.

00:18:32.700 --> 00:18:34.320
>> And it's consistent.

00:18:34.320 --> 00:18:35.847
>> It's consistent
[CROSSTALK] yeah, okay.

00:18:35.847 --> 00:18:38.631
So it's done.

00:18:38.631 --> 00:18:43.210
Now if I do docker images

00:18:43.210 --> 00:18:47.290
I can see here that I now
have this image demonginx.

00:18:47.290 --> 00:18:48.330
So let's take a look-
>> So

00:18:48.330 --> 00:18:50.000
it's increased in size by what?

00:18:50.000 --> 00:18:51.550
We took an 18 meg.

00:18:51.550 --> 00:18:52.637
>> Yep.
>> And that will be

00:18:52.637 --> 00:18:55.812
the size essentially for
the most part of end genetics.

00:19:03.654 --> 00:19:04.490
Yeah there you go.

00:19:04.490 --> 00:19:05.830
So end genetic 18 meg.

00:19:05.830 --> 00:19:07.180
>> Yep.

00:19:07.180 --> 00:19:10.290
>> The rest of the changes
which were your.

00:19:10.290 --> 00:19:11.030
Firewall and

00:19:11.030 --> 00:19:14.390
you'll work until its reading
the command prompt zero so.

00:19:14.390 --> 00:19:19.040
And you can see here, so we
derived this from demo which had

00:19:19.040 --> 00:19:22.820
five layers, instead of adding
just another layer it added

00:19:22.820 --> 00:19:25.850
quiet a few layers and you can
actually see each one of these

00:19:25.850 --> 00:19:31.750
layers contains The steps that
we ran in the dockerfile.

00:19:31.750 --> 00:19:36.590
So we talked about strategies
around creating images.

00:19:36.590 --> 00:19:38.210
There's a couple things
that go into this and

00:19:38.210 --> 00:19:40.410
you wanna watch what you're
putting in your dockerfile.

00:19:40.410 --> 00:19:41.540
>> Yeah.
>> And there's some

00:19:41.540 --> 00:19:45.110
tricks we can do to kind of
>> Make that

00:19:45.110 --> 00:19:46.450
amount of layers smaller.

00:19:46.450 --> 00:19:49.220
>> Yeah, and if you have
a quite complex container, or

00:19:49.220 --> 00:19:52.160
a quite complex
requirement that you

00:19:52.160 --> 00:19:54.040
would channel in
the docker file.

00:19:54.040 --> 00:19:57.770
That could be quite a big list,
when you run the command.

00:19:57.770 --> 00:19:59.403
>> Yes, take a look at this.

00:19:59.403 --> 00:20:01.214
So I'm gonna do.

00:20:09.324 --> 00:20:11.531
So I've got another
Docker file here.

00:20:11.531 --> 00:20:13.730
So we created a container,
we put EngineX in it.

00:20:13.730 --> 00:20:19.060
Let's take it one step further
and in addition to, well,

00:20:19.060 --> 00:20:21.750
we'll use that container that
includes the web software, but

00:20:21.750 --> 00:20:24.000
let's go ahead and
put an application into it.

00:20:24.000 --> 00:20:27.230
And then we'll run that
application and move it around.

00:20:27.230 --> 00:20:27.930
One of the things,

00:20:27.930 --> 00:20:31.030
looking at this Docker
file that I've done, so

00:20:31.030 --> 00:20:35.480
I'm actually installing several
things with this Docker file.

00:20:35.480 --> 00:20:38.500
So I'm running app get update.

00:20:38.500 --> 00:20:43.430
I'm then installing git
program called nano, In cURL.

00:20:44.870 --> 00:20:49.930
This slash here is basically
a carriage return.

00:20:49.930 --> 00:20:50.470
>> Yep.
>> But

00:20:50.470 --> 00:20:53.490
essentially this one command.

00:20:53.490 --> 00:20:55.330
>> Right.
>> So in one command,

00:20:55.330 --> 00:20:57.580
I'm installing all
this software.

00:20:57.580 --> 00:21:00.260
As opposed to having
an individual command

00:21:00.260 --> 00:21:01.120
to install each.

00:21:01.120 --> 00:21:04.303
So you can see here is
an example where I'm minimizing

00:21:04.303 --> 00:21:06.436
the amount of layers
that [CROSSTALK]

00:21:06.436 --> 00:21:07.477
>> There wouldn't be four

00:21:07.477 --> 00:21:08.470
entries on that list.

00:21:08.470 --> 00:21:09.680
It would just be a single entry.

00:21:09.680 --> 00:21:10.310
>> Exactly.
>> Okay.

00:21:10.310 --> 00:21:11.580
I see.
>> So, little tricks like

00:21:11.580 --> 00:21:14.210
this to kind of keep
the layers down.

00:21:14.210 --> 00:21:15.040
>> Right.

00:21:15.040 --> 00:21:16.650
So let me go ahead and
build this.

00:21:16.650 --> 00:21:20.570
Actually, let's take a look
at that again real quick,

00:21:20.570 --> 00:21:22.090
call out a couple
things that I'm doing.

00:21:22.090 --> 00:21:24.690
So not only am I
installing software here,

00:21:24.690 --> 00:21:28.010
I'm doing a little,
a little bit of configuration

00:21:28.010 --> 00:21:31.840
with the web server software
that's inside of the container,

00:21:31.840 --> 00:21:34.250
but also notice here
I'm running get clone.

00:21:35.260 --> 00:21:38.540
I am actually cloning
an application from GitHub

00:21:38.540 --> 00:21:41.000
into the container
at build time.

00:21:41.000 --> 00:21:43.820
So I am installing some
software, reaching out,

00:21:43.820 --> 00:21:48.350
getting some static files which
is basically a website that we

00:21:48.350 --> 00:21:51.622
will see-
>> [INAUDIBLE]

00:21:51.622 --> 00:21:54.471
it as a webserver.

00:21:54.471 --> 00:21:57.228
>> Yep, exactly.

00:21:59.500 --> 00:22:02.300
And I'm actually gonna put
some metadata on this.

00:22:06.103 --> 00:22:11.310
Neil Peterson, and
I'll call this image c9app.

00:22:13.040 --> 00:22:13.580
And build it.

00:22:15.040 --> 00:22:17.330
And what this Neil Peterson
does here is,

00:22:17.330 --> 00:22:19.010
I've got an account
in Docker Hub.

00:22:19.010 --> 00:22:19.590
>> Right.
>> And

00:22:19.590 --> 00:22:21.800
it's just basically a key value.

00:22:21.800 --> 00:22:25.030
When I go to push this it will

00:22:25.030 --> 00:22:26.800
push this image-
>> To your-

00:22:26.800 --> 00:22:28.220
>> To my account in Docker Hub.

00:22:28.220 --> 00:22:29.120
>> That makes sense.

00:22:29.120 --> 00:22:31.520
>> Yep, so it's going through,
it's building all of the, or

00:22:31.520 --> 00:22:33.160
it's installing the software.

00:22:33.160 --> 00:22:34.980
It's gonna go out to Git0Hub.

00:22:34.980 --> 00:22:36.960
Grab the application,

00:22:36.960 --> 00:22:39.980
bring it into the container
image, and then we'll have this

00:22:39.980 --> 00:22:42.010
container image that's
comprised of several layers.

00:22:42.010 --> 00:22:46.010
We started with a boonton base
os, then we installed the web

00:22:46.010 --> 00:22:49.540
server software, now we're
installing the application.

00:22:49.540 --> 00:22:51.130
Once that's done,
we'll deploy it,

00:22:51.130 --> 00:22:54.170
we'll start looking at
the networking pieces now.

00:22:54.170 --> 00:22:57.920
So we've kind of looked
at Image layering here.

00:22:57.920 --> 00:23:00.030
We'll start talking about
those networking pieces, and

00:23:00.030 --> 00:23:03.220
if I wanted to, maybe have
several instances of this on

00:23:03.220 --> 00:23:07.660
the same host, how do I do that
external, internal port mapping.

00:23:07.660 --> 00:23:09.910
So that I can access it.

00:23:09.910 --> 00:23:13.490
So, we're done, so

00:23:13.490 --> 00:23:18.590
let's do doctor images And
there it is.

00:23:18.590 --> 00:23:21.812
So there's my channel nine app.

00:23:24.103 --> 00:23:27.010
So with that ready,
let's go ahead and run it.

00:23:27.010 --> 00:23:28.410
So I'm gonna do Docker run

00:23:29.500 --> 00:23:33.400
Now up to this point we have
been running dash t and

00:23:33.400 --> 00:23:37.200
jumping right inside of our kind
of opening a session inside of

00:23:37.200 --> 00:23:39.290
our container where we can
interact with the file system.

00:23:39.290 --> 00:23:41.860
I wanna do something different
here and run a dash d which

00:23:41.860 --> 00:23:44.140
basically runs the container
in the background.

00:23:44.140 --> 00:23:48.190
>> Okay, with whatever default
settings were configured.

00:23:48.190 --> 00:23:49.530
>> Yup, exactly.

00:23:49.530 --> 00:23:54.740
All right, so
doc can run dash d And

00:23:54.740 --> 00:23:58.310
I'll grab our container image,
and bam.

00:24:00.520 --> 00:24:04.790
If I do a doc or ps, we can see
here is my running container,

00:24:04.790 --> 00:24:07.720
and again doc or ps will
show all running containers

00:24:07.720 --> 00:24:11.210
Docker PS dash A shows
all containers running or

00:24:11.210 --> 00:24:13.290
stopped it's the best name so
far as well.

00:24:13.290 --> 00:24:15.730
What are we getting here.

00:24:15.730 --> 00:24:16.586
Kickass grey.

00:24:16.586 --> 00:24:17.718
>> Nice.

00:24:24.811 --> 00:24:28.010
>> Someone take
the IP address of

00:24:28.010 --> 00:24:29.100
>> The container host.

00:24:30.230 --> 00:24:31.770
Drop it in here.

00:24:31.770 --> 00:24:33.560
However, notice that
nothing happened.

00:24:33.560 --> 00:24:34.460
It didn't find anything.

00:24:34.460 --> 00:24:36.260
So I intentionally left
something out there and

00:24:36.260 --> 00:24:37.690
that's this networking piece.

00:24:37.690 --> 00:24:38.270
>> Right.
>> So

00:24:38.270 --> 00:24:41.610
I'm hitting the external IP
address of the container host,

00:24:41.610 --> 00:24:44.510
but I've really given
it no instructions on

00:24:44.510 --> 00:24:47.640
how to pass that request
on to the container.

00:24:49.970 --> 00:24:51.990
So in order to do that.

00:24:51.990 --> 00:24:54.420
We can add an additional
piece here which is a dash P.

00:24:54.420 --> 00:24:58.190
And kinda define
some port mappings.

00:24:58.190 --> 00:25:02.930
So for this first run I'm gonna
map port 80 from the container

00:25:02.930 --> 00:25:05.840
host port 80 of
the container itself.

00:25:05.840 --> 00:25:12.620
So 80, 80 So basically
the same command, docker run,

00:25:12.620 --> 00:25:17.910
space dash D space dash P, 80 80
and then the name of the image.

00:25:19.090 --> 00:25:24.710
So with that done,
I should now get my application.

00:25:24.710 --> 00:25:25.260
>> There you go.

00:25:25.260 --> 00:25:27.530
I pulled that down
from GitHub as well.

00:25:27.530 --> 00:25:29.380
>> Yes, so the application
came from GitHub as well.

00:25:29.380 --> 00:25:30.560
>> Nice.

00:25:30.560 --> 00:25:35.140
All right, so now, so
we can see this mapping here.

00:25:35.140 --> 00:25:38.060
But you can quickly be obvious,

00:25:38.060 --> 00:25:40.810
i mean I've got one
port 80 on the host.

00:25:40.810 --> 00:25:41.370
>> Yeah.
>> Let's

00:25:41.370 --> 00:25:45.580
say I wanted to run 300 of these
things inside of my container.

00:25:45.580 --> 00:25:47.190
Maybe this is a service.

00:25:47.190 --> 00:25:48.240
That I'm selling.

00:25:48.240 --> 00:25:50.600
You log in,
you buy a service, and

00:25:50.600 --> 00:25:52.410
all I'm doing is spinning
up a container, but

00:25:52.410 --> 00:25:56.420
I've got a bunch of these, and
how do I map additional ports?

00:25:56.420 --> 00:25:57.300
>> Yeah.

00:25:57.300 --> 00:25:59.880
>> So I'm just gonna run
the exact same command, but

00:25:59.880 --> 00:26:01.920
this time I'll map
port 81 to 80,

00:26:01.920 --> 00:26:05.060
and maybe we just run this
a couple different times.

00:26:06.110 --> 00:26:07.900
So, 82.

00:26:07.900 --> 00:26:12.890
So what I'm saying is, port 83
on my host mapped to port 80 on

00:26:12.890 --> 00:26:16.140
this new instance of
the container that I'm running.

00:26:16.140 --> 00:26:19.590
I'll just do, port 81.

00:26:19.590 --> 00:26:24.070
It's good to have a random one,
and

00:26:24.070 --> 00:26:29.150
then I'll do 85 So now,
if we run docker ps, we can see

00:26:29.150 --> 00:26:32.940
I have a whole bunch of these
things running on my host now.

00:26:32.940 --> 00:26:36.100
>> And it's creative containers
free to them as well.

00:26:36.100 --> 00:26:36.710
>> Yeah, so

00:26:36.710 --> 00:26:40.020
I've got individual container,
so I've got multiple instances

00:26:40.020 --> 00:26:42.710
of that container image running
that application running.

00:26:42.710 --> 00:26:43.290
>> Yeah.
>> And

00:26:43.290 --> 00:26:49.145
I've got all the port mapping
>> Such that now, And let me.

00:26:53.936 --> 00:26:55.895
Grab my IP address again.

00:27:04.770 --> 00:27:09.616
So if do like port 81 there's
the application Port 83, there's

00:27:09.616 --> 00:27:14.209
the application, and I'll just
grab one that we didn't set up,

00:27:14.209 --> 00:27:18.580
87, and it's just spinning it,
didn't find anything.

00:27:18.580 --> 00:27:19.510
>> Yeah, nice.

00:27:19.510 --> 00:27:28.510
>> Okay, so that was, so
we've looked at image layering,

00:27:28.510 --> 00:27:31.950
we've looked at port mapping,
now let's take this full circle

00:27:31.950 --> 00:27:36.140
and take this image
>> Throw it up in a docker hub.

00:27:36.140 --> 00:27:36.710
>> Yeah.
>> And

00:27:36.710 --> 00:27:40.250
then we'll pull it over into
an Azure VM, running Linux and

00:27:40.250 --> 00:27:43.420
the docker engine, just to
see some of that portability.

00:27:44.550 --> 00:27:45.230
>> Great.

00:27:45.230 --> 00:27:49.150
>> All right, docker images, so

00:27:49.150 --> 00:27:52.140
it's this one right here
that I wanna throw up there.

00:27:53.280 --> 00:27:59.350
So I'll do docker push
>> And my image name.

00:28:02.610 --> 00:28:03.730
And while that's uploading,

00:28:14.436 --> 00:28:15.910
See here's my Docker Hub.

00:28:15.910 --> 00:28:19.190
I've got a couple of my personal
images already positioned here.

00:28:19.190 --> 00:28:20.380
>> Yep.
>> And in

00:28:20.380 --> 00:28:23.390
just a little bit we should
see this new image as well.

00:28:23.390 --> 00:28:26.470
>> So is it essentially, will
it know that your dependencies

00:28:26.470 --> 00:28:28.310
perhaps already exist?

00:28:28.310 --> 00:28:29.130
And you hope
>> Yeah, yeah.

00:28:29.130 --> 00:28:30.600
>> that therefore it
won't need to push

00:28:30.600 --> 00:28:32.660
the full amount each time, or
>> Yeah, exactly.

00:28:32.660 --> 00:28:34.050
So Docker kinda takes care of,

00:28:34.050 --> 00:28:36.965
again, managing those layers for
us.

00:28:36.965 --> 00:28:37.680
>> Mm-hm.

00:28:37.680 --> 00:28:41.460
Okay, cause yeah you've got 286
meg, but I'm assuming that But

00:28:41.460 --> 00:28:43.290
based on the size of
the current image.

00:28:43.290 --> 00:28:46.160
But I'm assuming that most of
that if not the vast majority

00:28:46.160 --> 00:28:47.480
will already exist.

00:28:47.480 --> 00:28:48.680
>> Yep, exactly.

00:28:48.680 --> 00:28:52.480
And in the reverse, if I've got
a host that has no images on it

00:28:52.480 --> 00:28:54.430
and I go pull down our C9 app.

00:28:54.430 --> 00:28:57.560
>> You know and it will say like
hey included in this it's got

00:28:57.560 --> 00:28:59.560
a dependency on
the Ubuntu image.

00:28:59.560 --> 00:29:00.800
Let's pull that down as well,
and

00:29:00.800 --> 00:29:04.480
it will actually pull down all
of the associated images or

00:29:04.480 --> 00:29:07.150
all the reference images
based on the image that

00:29:07.150 --> 00:29:08.160
you're pulling down.

00:29:08.160 --> 00:29:11.865
>> And, do you need to have any
special account to sign up for

00:29:11.865 --> 00:29:13.130
Dr. Hub, can anybody sign up?

00:29:13.130 --> 00:29:15.530
>> Yeah, you can just go to Dr.
Hub and sign up.

00:29:15.530 --> 00:29:17.790
>> Right, and there's no
>> A 500 meg to play with,

00:29:17.790 --> 00:29:19.680
have I got an unlimited amount?

00:29:19.680 --> 00:29:21.630
>> I'm not sure
on those details.

00:29:21.630 --> 00:29:23.640
>> Okay, I'm sure you can check.

00:29:23.640 --> 00:29:25.850
>> Yeah, but
additionally docker as well,

00:29:25.850 --> 00:29:28.730
they've got the software to
create private hubs as well.

00:29:28.730 --> 00:29:29.960
>> Right, for enterprises.

00:29:29.960 --> 00:29:32.790
>> What we're dealing with right
here is kinda the public facing

00:29:32.790 --> 00:29:35.230
one, but you can create your own
private repositories as well.

00:29:35.230 --> 00:29:36.390
>> Would anybody, therefore,

00:29:36.390 --> 00:29:38.380
be able to get to
your apps on here?

00:29:38.380 --> 00:29:39.780
>> Right now, yep, absolutely.

00:29:39.780 --> 00:29:40.620
>> Okay, fair enough.

00:29:40.620 --> 00:29:43.290
So you can create
your own private one?

00:29:43.290 --> 00:29:44.120
>> Yes.

00:29:44.120 --> 00:29:44.730
>> Okay, nice.

00:29:46.020 --> 00:29:47.630
>> All right, so we're done.

00:29:47.630 --> 00:29:49.010
If I go up to Docker Hub and

00:29:49.010 --> 00:29:53.310
refresh this,
there it is right there.

00:29:53.310 --> 00:29:55.546
>> Yeah, nice.

00:29:55.546 --> 00:30:01.011
So what I'm going to do now is,
I've got a Linux VM

00:30:01.011 --> 00:30:06.753
running in Azure and
it's configured with Docker.

00:30:06.753 --> 00:30:09.548
So I'm just create
a session on that VM.

00:30:16.868 --> 00:30:19.262
This is running in Microsoft
This isn't running the same,

00:30:19.262 --> 00:30:20.984
this isn't in the same VM
that was running on your

00:30:20.984 --> 00:30:21.740
laptop before.

00:30:21.740 --> 00:30:22.280
>> Exactly.

00:30:22.280 --> 00:30:24.108
>> Okay, let's just go and
take a look at it.

00:30:36.283 --> 00:30:41.410
Bunch of capabilities in Azure
around doctor and containers.

00:30:41.410 --> 00:30:43.980
Definitely something we can dig
into in a future video cuz there

00:30:43.980 --> 00:30:46.360
is just a ton of,
ton of capability in here.

00:30:47.410 --> 00:30:51.230
And so if we look at Resource
groups and TWODocker,

00:30:53.480 --> 00:30:56.830
I basically had a resource
group that includes a VM and

00:30:56.830 --> 00:31:00.379
public facing IP address
[INAUDIBLE] whatnot that is.

00:31:00.379 --> 00:31:02.785
>> Okay.
>> Fully configured with Docker

00:31:02.785 --> 00:31:04.060
and we'll come back to that.

00:31:04.060 --> 00:31:07.340
So if I a docker ps -a,

00:31:07.340 --> 00:31:10.390
You can see I've got no
containers running on this host.

00:31:10.390 --> 00:31:15.310
If I do docker images we can
see that I've got no docker

00:31:15.310 --> 00:31:16.380
images here as well.

00:31:18.540 --> 00:31:20.270
I'll do docker search app.

00:31:20.270 --> 00:31:24.720
Alright, so you can see

00:31:24.720 --> 00:31:29.540
from docker hub it's found
The app that we just created, so

00:31:29.540 --> 00:31:33.480
I'll do docker run -d -p.

00:31:33.480 --> 00:31:36.160
So again I wanna map ports.

00:31:36.160 --> 00:31:38.190
>> So you're not gonna do I
need to pull this over then

00:31:38.190 --> 00:31:39.940
create a container, you're just
gonna do all of it in one shot?

00:31:39.940 --> 00:31:40.440
>> Yeah, exactly.

00:31:40.440 --> 00:31:44.330
So I could run docker pool and
kinda stage that, but if I do

00:31:44.330 --> 00:31:48.300
a docker run and that image is
not already staged on the host,

00:31:48.300 --> 00:31:49.470
it'll reach out and
pull it down for me.

00:31:49.470 --> 00:31:50.388
>> Nice, okay, great.

00:31:52.524 --> 00:31:55.107
You need to give yourself
a review later on as well,

00:31:55.107 --> 00:31:56.801
you need a star on
there at least.

00:31:56.801 --> 00:31:58.577
>> [LAUGH]
>> For the C9 app, yep,

00:31:58.577 --> 00:31:59.317
absolutely.

00:31:59.317 --> 00:32:00.723
>> You can see right there,

00:32:00.723 --> 00:32:02.721
unable to find
the image locally.

00:32:02.721 --> 00:32:03.350
>> Mm-hm.
>> And so

00:32:03.350 --> 00:32:04.160
it's gonna go out and pull it.

00:32:04.160 --> 00:32:07.431
And you can see it's pulling
a bunch of different layers here

00:32:07.431 --> 00:32:10.895
and that's gonna be Not only the
container image that we created

00:32:10.895 --> 00:32:13.862
on this laptop- [CROSSTALK] But
all the dependencies.

00:32:13.862 --> 00:32:15.686
While this is pulling down,

00:32:15.686 --> 00:32:19.334
a couple things to call out
specific to Azure because I'm

00:32:19.334 --> 00:32:22.526
mapping Port 80 into 80
I'm gonna need to have

00:32:22.526 --> 00:32:25.280
Azure configured to
accept that traffic.

00:32:25.280 --> 00:32:27.420
>> Yep, so you need an end
point configured for the VM.

00:32:27.420 --> 00:32:28.150
>> Yep, yep.
So I've

00:32:28.150 --> 00:32:31.340
got a network security
group configured.

00:32:31.340 --> 00:32:35.840
In Azure with some
inbound rules, so

00:32:35.840 --> 00:32:37.650
we've got 80 right
there which will work.

00:32:37.650 --> 00:32:40.640
One thing that we haven't looked
at just while this runs is

00:32:40.640 --> 00:32:44.230
Windows Server containers,
managing those with Docker.

00:32:44.230 --> 00:32:48.490
I mean, most of what we've seen
here is exactly how you would

00:32:48.490 --> 00:32:50.580
work with a Windows Server
container as well.

00:32:50.580 --> 00:32:53.210
>> And a couple of other
videos on the channel actually

00:32:53.210 --> 00:32:54.070
do show that.

00:32:54.070 --> 00:32:55.480
>> Yep.
>> And anybody's who's watched

00:32:55.480 --> 00:32:57.750
those and
looking at these commands,

00:32:57.750 --> 00:32:59.560
they're practically identical,
if not identical.

00:32:59.560 --> 00:33:00.160
>> Practically identical,

00:33:00.160 --> 00:33:03.290
yeah, all the way down to
working with the docker files.

00:33:03.290 --> 00:33:04.580
>> Yep.
>> All right, so

00:33:04.580 --> 00:33:05.570
that's completed, so

00:33:05.570 --> 00:33:07.810
if I do docker ps,
>> So

00:33:07.810 --> 00:33:10.030
that image is now
on your Azure VM.

00:33:10.030 --> 00:33:12.860
So it's been pulled from the
Docker Hub to Azure inside your

00:33:12.860 --> 00:33:15.880
VM and the container has
been created from that.

00:33:15.880 --> 00:33:17.700
>> It's been created and
it's running.

00:33:17.700 --> 00:33:19.270
>> Right.
>> So now if I take the-

00:33:19.270 --> 00:33:20.055
>> The moment of truth.

00:33:20.055 --> 00:33:22.060
>> [LAUGH] The IP address for,

00:33:22.060 --> 00:33:25.520
the public IP address
of my Azure VM.

00:33:25.520 --> 00:33:26.570
Drop it in there.

00:33:26.570 --> 00:33:28.340
I'd mapped port 80 to port 80.

00:33:28.340 --> 00:33:29.030
>> Boom.

00:33:29.030 --> 00:33:31.490
>> And there's my application
running in Azure so.

00:33:31.490 --> 00:33:32.840
>> Nice.
So it's now at hyper-scale?

00:33:32.840 --> 00:33:34.306
>> Yeah pretty much yeah.

00:33:34.306 --> 00:33:37.716
[LAUGH] So for full circle we,
built the application

00:33:37.716 --> 00:33:41.057
[CROSSTALK] on my laptop,
push it up to Docker Hub.

00:33:41.057 --> 00:33:43.590
Pulled that over into Azure.

00:33:43.590 --> 00:33:47.760
While doing so we looked at some
of the network port mappings.

00:33:47.760 --> 00:33:49.460
>> Yeah.
>> When we've got those behind

00:33:49.460 --> 00:33:52.810
net and then we've kind of
looked at how those images work

00:33:52.810 --> 00:33:54.250
when layered on
top of each other.

00:33:54.250 --> 00:33:54.750
>> Awesome.

00:33:58.760 --> 00:34:01.300
I think you would agree that
as a demo from end to end it

00:34:01.300 --> 00:34:03.300
doesn't get much
better than that.

00:34:03.300 --> 00:34:04.630
You've built the app.

00:34:05.670 --> 00:34:08.850
Moved it to a place where it's
accessible for all of your,

00:34:08.850 --> 00:34:11.710
let's say the Y developement
team, who can then pull it

00:34:11.710 --> 00:34:14.470
to their machine, whether their
on a laptop or workstation or

00:34:14.470 --> 00:34:17.520
data center server, or
up in the public cloud.

00:34:17.520 --> 00:34:19.480
I mean, that is,
it's cool stuff.

00:34:19.480 --> 00:34:22.340
And if you want to learn more
Stay tuned to the channel

00:34:22.340 --> 00:34:24.680
because in future videos we'll
be going into equal levels of

00:34:24.680 --> 00:34:28.270
depth in some of the other areas
both on Windows 7 containers and

00:34:28.270 --> 00:34:31.290
on the Lenox platform as well,
as your container services,

00:34:31.290 --> 00:34:33.710
a whole host of stuff in
different directions we'll

00:34:33.710 --> 00:34:35.320
be going in, so stay tuned.

00:34:35.320 --> 00:34:36.800
But in terms of
recommended resources,

00:34:36.800 --> 00:34:37.780
make sure you check out and

00:34:37.780 --> 00:34:40.140
download the latest Windows
7 technical preview.

00:34:40.140 --> 00:34:40.770
To try this out.

00:34:40.770 --> 00:34:43.520
Obviously, you can use Linux
[INAUDIBLE] if you wanna follow

00:34:43.520 --> 00:34:46.120
the demos that Neil delivered,
you could follow along and

00:34:46.120 --> 00:34:48.770
do similar things to
aid your learning.

00:34:48.770 --> 00:34:52.790
Check out the Docker resources
on Docker.com\Microsoft in

00:34:52.790 --> 00:34:58.700
the Docker docs website so,
Docker.com\Windows\started.

00:34:58.700 --> 00:35:00.835
And check out the containers
documentation on

00:35:00.835 --> 00:35:03.800
msdn.microsoft.com and
on Github.

00:35:03.800 --> 00:35:05.830
And with that, nothing more
to say, thanks Neil so

00:35:05.830 --> 00:35:07.780
far for your help in the series.

00:35:07.780 --> 00:35:08.340
>> Appreciate it.

00:35:08.340 --> 00:35:10.147
>> And we'll see you again on
another containers channel

00:35:10.147 --> 00:35:10.897
episode, thank you.

00:35:10.897 --> 00:35:20.897
[MUSIC]

