Deploying Elastic Beanstalk applications from Docker containers - AWS Elastic Beanstalk

Deploying Elastic Beanstalk applications from Docker containers

Elastic Beanstalk supports the deployment of web applications from Docker containers. With Docker containers, you can define your own runtime environment. You can also choose your own platform, programming language, and any application dependencies, such as package managers or tools, which typically aren't supported by other platforms. Docker containers are self contained and include all the configuration information and software that your web application requires to run. All environment variables that are defined in the Elastic Beanstalk console are passed to the containers.

By using Docker with Elastic Beanstalk, you have an infrastructure that handles all the details of capacity provisioning, load balancing, scaling, and application health monitoring. You can easily manage your web application in an environment that supports the range of services that are integrated with Elastic Beanstalk.

The topics in this chapter assume that you have some knowledge of Elastic Beanstalk environments. If you haven't used Elastic Beanstalk before, try the getting started tutorial to learn the basics. This chapter also assumes that you have a basic understanding of Docker and how it works. For more information see Docker overview on the Docker website.

The Docker platform family

The Docker platform family for Elastic Beanstalk includes the following platforms branches.

  • Docker Running on 64bit Amazon Linux 2

  • ECS Running on 64bit Amazon Linux 2

For more information about supported platform branches for each Docker platform, see the Supported Platforms page in the AWS Elastic Beanstalk Platforms document.

Docker running on Amazon Linux 2

This platform branch offers both single-container and multi-container support. Elastic Beanstalk deploys a Docker image and source code to EC2 instances on this platform branch. Use the Docker Compose tool on the Docker platform to simplify your application configuration, testing, and deployment. For more information about this platform branch, see Using the Docker platform branch.

ECS running on 64bit Amazon Linux 2

This platform branch uses Amazon ECS to coordinate a deployment of multiple Docker containers to an Amazon ECS cluster in an Elastic Beanstalk environment. The instances in the environment each run the same set of containers, which are defined in a Dockerrun.aws.json file. For more information, see Using the Amazon ECS platform branch.

Note

On July 18,2022, Elastic Beanstalk set the status of all platform branches based on Amazon Linux AMI (AL1) to retired. For more information about migrating to a current and fully supported Amazon Linux 2 platform branch, see Migrating your Elastic Beanstalk Linux application to Amazon Linux 2.

This platform branch can be used to deploy a Docker image, described in a Dockerfile or a Dockerrun.aws.json v1 definition. This platform only supports the Amazon Linux AMI operating system, (the version that precedes Amazon Linux 2), and it runs only one container for each instance.

We recommend that you create your environments with the newer and supported platform branch Docker running on 64bit Amazon Linux 2. For more information, see Using the Docker platform branch.

This platform branch uses Amazon ECS to coordinate a deployment of multiple Docker containers to an Amazon ECS cluster in an Elastic Beanstalk environment. However, it only supports the Amazon Linux AMI operating system, (the version that precedes Amazon Linux 2). Instead of using this platform branch, we recommend that you use one of the prior-mentioned Docker platform branches that run on Amazon Linux 2.

If you're already using this platform branch, we recommend that you migrate to the latest ECS Running on 64bit Amazon Linux 2 platform branch. The latest platform branch supports all of the features from this discontinued platform branch. No changes to the source code are required. For more information, see Migrating Multi-container Docker running on Amazon Linux to ECS on Amazon Linux 2.

In addition to the two generic Docker platforms, there is also the Preconfigured Docker GlassFish platform branch that runs on the Amazon Linux AMI operating system, (the version that precedes Amazon Linux 2).

This platform branch has been superseded by the platform branch Docker Running on 64bit Amazon Linux 2. Deploy GlassFish and your application code to an Amazon Linux 2 Docker image to easily migrate your GlassFish application to this newer and supported platform branch. For more information, see Deploying a GlassFish application to the Docker platform.