Unless section we created our docker file and built a new image for a new application we should now
be able to start up our application by running docker run and that will specify the image we just created.
So you will put in your docker username slash visit's And remember you do not have to specify the tag
by putting on colon colon latest at the end but you actually can if you want to.
So we can run this right here and we'll start up our application.
No notice so we immediately get an error message.
It says read it's connection to something something something failed.
So our application is attempting to start up but there's no register server running for it to connect
to.
So in this section we're going to focus on getting a separate container running a Gratus server.
Now as far as getting up a separate read as server goes well it's going to be pretty darn straightforward.
We're going to run the same exact command that we've ran throughout this course or run docker run rattus
like so and so that's going to reach out to the docker hub.
It's going to pull down to read assistance and all start up a copy of read us on our local machine and
boom just like that.
There's our read a server.
So that's it.
That's the reticence instance we're going to use no customization to the docker image for it whatsoever.
It's now that we have our talk or e-mail or read a server running.
I'm going to open up a second terminal window and inside the second window or now try running docker
run my image again.
So say Dr. Ron.
Stephen Grider slash visit's.
Let's run that and you'll notice.
Well it looks like we still have the same error message we had before.
Even though we are now running a red S server inside of a separate container.
So what's the problem.
Well let's think about it for a second.
Here's what's going on on your computer right now.
You've got a node application in one container and the read us application in the separate dock or container.
Now these two containers do not have any automatic communication between the two whatsoever.
They are two absolutely isolated processes that don't have any communication.
So in order to make sure that our node app has the ability to kind of reach out to the red a server
and stored information or work with it in some fashion we need to set up some networking infrastructure
between the two.
You know when it comes to setting up some networking functionality between two separate containers we
have for right now two options to look at here's are two options.
We can either make use of the dockers Seelye that we've been making use of throughout this course so
far.
You know I'm talking about the docker command that we've been using at our terminal throughout this
entire course.
This built in Dr. Seelye has functionality tied to it that will allow us to set up a network between
two separate containers.
However there's a little issue with it and the issue is basically just that it's a real pain in the
neck to do when you make use of Dr. Selye to set up some networking.
It's going to involve a handful of different commands that we rewrite on every single time you start
up your different containers.
Now of course we could make some type of little script to run all that stuff for us but you know certainly
it's gonna involve a lot of typing and a lot of thought on how we're going to set up all this networking
stuff.
I'm going to be honest with you I have just about never seen people in industry ever make an use of
Dockers built in the dock or.
Let me very clear here never making use of Dharker ceilings built in networking features to connect
two containers together much more frequently.
What you're going to see in what you and I are going to do inside this course is we're going to make
use of a separate CSI tool called docker compose docker compose is a separate tool that gets installed
along with docker.
So if you right now flip back over to your terminal and run docker dash compose like so you should see
some content appear on the screen and list out a series of different commands for you to run docker
compose a separate Seelye.
It's already installed on your machine.
Now when you start introducing Dharker compose it's going to very quickly start getting confusing.
What docker composed does and what Dr. Seelye does and what the relationship between the two is.
It's the best thing I can tell you is that Ducker can pose really exists to keep you from having to
write out a ton of different repetitive commands with the Dr. Selye Sarette throughout this course we've
been running stuff like Daka run and Dharker attach an exec and we've been specifying ports and tags
and all this stuff to us all the time.
Now definitely as we learn this stuff you know we need to use Takhar Seelye and learn it.
But at a certain point time you say OK you know I understand this Dr. Selye stuff and you get tired
of writing out those commands.
So one of the big purposes of Dharker compose is to just avoid having to write out all these really
annoying tiny little options every time you want to start up a container The other big thing that Dr.
compose is going to do for us is it's going to make it very easy and very straightforward to start up
multiple docker containers at the same time and automatically connect them together with some form of
networking and it's all going to happen behind the scenes for us quite automatically.
So again as soon as you start seeing this terminology here of Dharker compose you know keeping all these
docker terms straight in your head gets a little bit confusing.
I to tell you this right now.
I mean repeat it several times.
The purpose of Dr. compose is to essentially function as Dr. Seelye but allow you to kind of issue multiple
commands much more quickly.
So let's take a quick break right here.
We're going to come back the next section and we're going to get a little bit more familiar with Dr.
compose and how it works.