Book Image

Effective DevOps with AWS - Second Edition

By : Yogesh Raheja, Giuseppe Borgese, Nathaniel Felsen
Book Image

Effective DevOps with AWS - Second Edition

By: Yogesh Raheja, Giuseppe Borgese, Nathaniel Felsen

Overview of this book

The DevOps movement has transformed the way modern tech companies work. Amazon Web Services (AWS), which has been at the forefront of the cloud computing revolution, has also been a key contributor to the DevOps movement, creating a huge range of managed services that help you implement DevOps principles. Effective DevOps with AWS, Second Edition will help you to understand how the most successful tech start-ups launch and scale their services on AWS, and will teach you how you can do the same. This book explains how to treat infrastructure as code, meaning you can bring resources online and offline as easily as you control your software. You will also build a continuous integration and continuous deployment pipeline to keep your app up to date. Once you have gotten to grips will all this, we'll move on to how to scale your applications to offer maximum performance to users even when traffic spikes, by using the latest technologies, such as containers. In addition to this, you'll get insights into monitoring and alerting, so you can make sure your users have the best experience when using your service. In the concluding chapters, we'll cover inbuilt AWS tools such as CodeDeploy and CloudFormation, which are used by many AWS administrators to perform DevOps. By the end of this book, you'll have learned how to ensure the security of your platform and data, using the latest and most prominent AWS tools.
Table of Contents (15 chapters)
Title Page
Packt Upsell

Chapter 7: Running Containers in AWS

  1. Docker is a container platform to build, ship and run containerized applications. The four important components of Docker Engine are as follows:
    • Containers: A read write template
    • Images: A read only template
    • Network: A virtual network for containers
    • Volumes: A persistent storage for containers
  1. Docker CE can be installed on many platforms including Linux, Windows, and MacOS. Refer to, the official Docker link, click on your choice of platform, and follow the instructions to install and configure the latest version of Docker CE on your system.

Confirm the installed Docker CE version by running docker --version command.

  1. Use a Dockerfile and create an image using docker build command. This newly created image is an image for Hello World application. Create a container by exposing the port outside using docker run -d -p 3000:3000 <image-name>. Once done, check and confirm the webserver outputs either using curl or using your public IP with port 3000 from the web browser.
  2. Login to your AWS account using your credentials and select ECS service from the services tab. There you will find options to Create Amazon ECS Cluster and Amazon ECR repository. At this point, click on Repository and create your first ECR repository. The screen will also display some of the commands that you can use to perform an operation on ECR. Similarly, click on the Cluster tab followed by create cluster on the ECS screen. From here, select your choice of cluster for Windows or Linux or Network only, click 'next step', and fill in the details of your choice. These details include cluster name, provisioning model, EC2 instance type, number of instance, and so on. To complete the process, click Create. Once a few minutes have passed, your ECS cluster will be ready to use. In this chapter, we have demonstrated this using CloudFormation. If you are interested in setting up an ECS cluster using the same process, feel free to follow the steps provided in the chapter in Creating an ECS cluster section.