-: In the last section,
we spoke about how we make a Dockerrun.aws.json file
to tell Elastic Beanstalk
how to work with our multiple containers.
Now, before we start working on this file,
I wanna show you a little piece of documentation
that's going to be very valuable
when you start making use of Elastic Beanstalk
on your own projects.
First, a little bit of behind the scenes action.
So Elastic Beanstalk doesn't actually know
how to work with containers,
especially a multi-container environment.
Behind the scenes,
when you tell Elastic Beanstalk to host a set of containers,
it's actually delegating that hosting
off to another service that is provided in Amazon,
called the Elastic Container Service,
which is abbreviated very frequently as ECS.
You work with Amazon ECS by creating files
that are called task definitions,
and a task definition is essentially a file
that tells ECS how to run one single container.
Each of these task definition files are very similar,
almost identical to the container definitions
that you and I are going to write
inside of our Dockerrun.aws.json file.
And so, the piece of documentation that I wanna show you
is the documentation around these task definitions.
Essentially, it's a really confusing thing
to understand here,
or to figure out I should say.
But, if you look at the documentation
for the docker run file,
it's not gonna tell you a lot
about the different options that you can pass
to these container definitions,
because it actually kind of wants you to go
and look at the documentation
for a task definition as defined by Amazon ECS.
So, that's why I'm showing this documentation,
'cause it's not immediately clear,
when you start reading the stuff,
that you need to go and read about this
completely different service that AWS is running,
if you want to figure out
how to customize your docker run file.
So, long story short, let's pop open a new tab.
We're going to pull up the documentation
for a task definition,
which is essentially what you and I are writing
inside of that docker run file.
So, I'm going to do a search for Amazon ECS task definition,
and then one of the first results you'll see here
is @docs.aws.amazon.com.
You're looking for Amazon ECS task definitions.
So, hopefully you'll see a page
that looks something like this right here.
If you scroll down just a little bit,
you'll see a topic of task definition parameters.
You'll come to this page,
and then on the right hand side,
you're gonna look for container definitions.
And so what you and I are going to write inside
of our Dockerrun.aws.json file
is essentially gonna follow the format
that you see right here.
So, this is the documentation that you can refer to
if you want to get a better understanding
of what we are writing inside that file.
So we're gonna add in properties like name, image, memory,
all this other stuff, to that file.
Okay, so now that you know where to look,
if you want to get some documentation around this stuff,
let's take a quick pause right here,
and then we'll get started on that file in the next section.