- Hi, I'm Cameron McKenzie.
I'm the Editor in Chief at TheServerSide.com.
and I want to show you
how to deploy a Docker Hub hosted Docker Container
over to the Amazon Elastic Container Service.
So I've logged into my Amazon console.
I got my Elastic Container Service.
You can upload a repository to AWS,
but to be honest with you,
I actually found that fairly difficult to do
in terms of getting all of the security tokens right.
But I've actually got a Docker image
for the spring boot microservice application
that I produced hosted over on dockerhub.com.
You can see it right there.
And the name of the Docker image is pl-rps service,
it stands for rock, paper, scissors,
and you can see,
we have a little bit of information here that says,
you can use this to pull it.
Now, I'm not gonna use that to pull it here.
What I'm gonna do is I'm gonna go over
to Amazon AWS Elastic Container Service,
and I'm gonna create a new task definition.
And in this task definition,
I'm gonna make it a Fargate definition.
I'm going to call it my rps task.
I'll make the task rule, None.
I'm just gonna maybe throw in a gig of memory there
and maybe a virtual CPU,
half a CPU is what looks like
what it's gonna be more agreeable to,
and then finally, I'm gonna specify the container
and here as I specify the container,
we'll call it the rps image on docker hub.
Okay. So that makes it pretty obvious what it is.
And it's right here,
I actually just linked to the Docker hub image.
Now, before we saw it linked to jheguevara/pl-rps service,
all I have to do is put in docker.io
and that should be my get out of jail free card
for not having any problems
in terms of allowing AWS to download that image.
I don't know, what do we want,
a hard limit of 512 for the memory, that looks fine.
For the port mappings, I'm gonna add 80 and also 8080.
Those are the two port mappings my application needs.
And I think at that point I am good to go.
So I'll click add, I will click create.
I'm not gonna add any volumes or anything like that.
So that's my task created.
And now with this task,
I want to actually run that on a cluster.
So it looks like I'm gonna need to create a cluster.
I'll create a Fargate cluster.
Cool.
My AWS Fargate cluster, I don't need a VPC for that.
The cluster is created.
And now what I wanna do is actually want to run that task
that's associated with my docker hub hosted container.
So I'm gonna click run new task.
I'm gonna run up Fargate.
It's the RPS tasks that I created earlier.
It's gonna run the Fargate cluster, task group.
I'm now gonna enter the cluster VPC, except that one,
throw in the first sub-net.
Now, the other thing that I need to do
is I need to edit the security groups.
I need to make sure that people can actually get to it.
So I'll do we have a security group to create,
we'll create a new security group.
So I'll create an all access security group.
And for that, I'll allow all TCP.
And I mean, I can really do overkill here by saying,
and it just allow all traffic altogether,
but I'll click save there.
That now associates this with my all access security group.
I'm now gonna click run task.
And this task may actually take a moment to run.
So you can see that it's currently provisioning.
I'll do a little refresh here.
It's gone from provisioning to pending
and right now, it's gonna be downloading my Docker image
from Docker hub.
So I would imagine that this is just gonna take a minute
for this to get up and running.
Oh, wow. Look at that.
Actually it looks like it pulled it in fairly quickly.
I'm not convinced that it's all running.
So I'm gonna click on the task right here,
it says that it's running,
it even says that I have a public IP address.
I still don't believe, I'm just gonna click on the logs.
And when click on the logs,
if I see some indication
that my spring boot application is running
and that there...
that ends up doing a little display for spring.
Well, it looks like everything is running.
They've (indistinct) web application is out there
running in the cloud.
So i gotta go back to my cluster.
I'm gonna take a look at this task.
It says that it's running on this public IP address.
Okay, well, let's go see how well this runs.
We'll go to port 8080 on the public IP.
And look at this, I got my rock paper scissors application.
Let's see if it works.
Okay, if I select rock it's a tie,
if it's paper, I win,
if it's scissors, it's a loss and you know what?
That's all there is to it.
So there you go.
That's how easy it is
to take a Docker Hub hosted Docker container,
move it over to AWS and host it on a Fargate cluster.
Pretty amazing stuff.