DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Adding a Custom Domain and SSL to AWS EC2
  • Understand the Sidecar Pattern by Deploying n8n to AWS Fargate
  • Automate Application Load Balancers With AWS Load Balancer Controller and Ingress
  • Keep Your Application Secrets Secret

Trending

  • Idempotency Under Concurrency: Why Your Application Check Isn't the Last Line of Defense
  • Beyond Manual Mapping: AI-Orchestrated Governance for Hybrid Cloud
  • How to Hide Sensitive Information Before You Share a File
  • You Do Not Need a PhD to Become an AI Engineer: The Essential Skill Stack

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Deploy Docker Images to AWS Fargate — Run Containers Without Managing Infrastructure

Deploy Docker Images to AWS Fargate — Run Containers Without Managing Infrastructure

This tutorial shows how you can deploy Docker images of microservices to AWS Fargate without having to worry about container management.

By 
Raman Sharma
·
Jun. 15, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
17.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In the previous article, we looked at how to create a simple Spring Boot application and push it over to DockerHub. In this final article of this series, we will look into using the Docker image and deploying the application using AWS Fargate. AWS Fargate is a technology for Amazon ECS and EKS that allows you to run containers without having to manage servers or clusters. Fargate is an abstraction, so instead of you managing your instances and clusters, it will accomplish this for you.

Picking up from where we left, we have our image at DockerHub. We could easily have this pushed to AWS ECR as well. On AWS Fargate, we have the option to choose an existing configuration or create a custom one. Since we are working with a Spring Boot application, we will choose "Custom."

Default Container Definitions

Click on "configure" to add the Container Definition.

Container name: employeeapp

Image: coolindguy/employeeapp

*By default, the field accepts images from Document Hub. If you are using ECR, you have to provide the complete ECR URL.

  1. Memory limits: We can leave it at the soft limit of 128 MiB for our sample deployment.
  2. Port mappings: The service is running on port 8080, so we can map it to the same.

Task Definition: A task definition describes one or more containers through attributes. We leave everything as default for our purposes.


awsvpc
Create new
FARGATE
0.5GB (512)
0.25 vCPU (256)

Defining the Service and provisioning an ALB:

employeeapp-service
(This can be changed to a desired count of simultaneous task definitions in a cluster).

Automatically create new

8080
HTTP

Define the cluster for the application:

Automatically create new
Automatically create new

This is the desired state of our deployment:

Image title

At this point, we can review our deployment state and click on the "create" button. I did not have much luck getting the desired state a few times, so be patient with that.

Image title

After you see all 10 tasks completed, you can see the service details by clicking "View Service."

You can navigate to "Target Group Name" -> "Load Balancer" to get the DNS Name of the Load Balancer URL, which should give load balancer access to your containerized application running on AWS Fargate.

The same application can be deployed via ECS as well, but Fargate abstracts a lot of the complexity and you can focus on your application and not have to worry about the nitty-gritty of container management.

AWS Docker (software) Load balancing (computing) application Spring Framework Task (computing) Infrastructure

Opinions expressed by DZone contributors are their own.

Related

  • Adding a Custom Domain and SSL to AWS EC2
  • Understand the Sidecar Pattern by Deploying n8n to AWS Fargate
  • Automate Application Load Balancers With AWS Load Balancer Controller and Ingress
  • Keep Your Application Secrets Secret

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook