Running Containers in AWS

Throughout Chapter 5, Scaling Your Infrastructure, our architecture changed quite a bit. We explored different ways to scale out applications in AWS. One of the major technologies that we left out is the concept of containers. Containers are at the heart of the systems development life cycle (SDLC) of many major technology companies.

So far in the book, we used our personal computer to develop our application. This works well for simple projects such as our helloworld application. On more complex projects with many dependencies, it's a different story. Ever heard of issues where a certain feature works on a developer's laptop, but not for the rest of the organization or, even worse, not in production? A lot of those issues come from the differences between environments. When we built our staging and production environments, we relied on CloudFormation and Ansible to keep those environments consistent. Unfortunately, we can't replicate that to our local development environment with ease.

Containers bring a new concept that will address this issue. With them, we can package an application and include the operating system, the application code, and everything in between. Containers can also help at a later stage when it's time to break out monoliths.

In this chapter, we will look at Docker, the most popular container technology. After a brief explanation of what Docker is and how to use its basic functionalities, we will Dockerize our application. This will help us understand the value of using Docker as a developer.

To appreciate the value of Docker used in production, we will look into the EC2 container service (ECS) from AWS. Using CloudFormation, we will create new templates to run containers across our environments. This will also give us the opportunity to create ALB instances. Finally, in the last section of the chapter, we will create a new deployment pipeline. We will introduce a new service called CodeBuild that we will use to build new containers. We will then deploy our containers on top of ECS using CodePipeline. So, in this chapter, we will be looking at the following topics:

  • Dockerizing our helloworld application
  • Using the EC2 container service
  • Updating our CI/CD pipeline to utilize ECS
This book covers ECS, but you have a few more options to use Docker in AWS. You can also take a look at CoreOS Tectonic (https://tectonic.com/), Mesosphere DC/OS (https://mesosphere.com), or Docker Datacenter (https://www.docker.com/products/docker-datacenter).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset