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.

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 branches

The Elastic Beanstalk Docker platform supports the following platform branches:

Docker running Amazon Linux 2 and Docker running AL2023

Elastic Beanstalk deploys Docker container(s) and source code to EC2 instances and manages them. These platform branches offer multi-container support. You can use the Docker Compose tool to simplify your application configuration, testing, and deployment. For more information about this platform branch, see Using the Docker platform branch.

ECS running on Amazon Linux 2 and ECS running on AL2023

We provide this branch for customers who need a migration path to AL2023/AL2 from the retired platform branch Multi-container Docker running on (Amazon Linux AMI). The latest platform branches support all of the features from the retired 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 2023. If you don't have an Elastic Beanstalk environment running on an ECS based platform branch, we recommend you use the platform branch, Docker Running on 64bit AL2023. This offers a simpler approach and requires less resources.

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 ECS cluster contains EC2 instances that host Docker containers. To accomplish this deployment orchestration, Elastic Beanstalk creates an ECS Task definition which also includes a Container definition. The instances in the environment each run the same set of containers, which are defined in a Dockerrun.aws.jsonv2 file. For more information, see Using the Amazon ECS platform branch.

Retired platform branches running on Amazon Linux AMI (AL1)

On July 18,2022, Elastic Beanstalk set the status of all platform branches based on Amazon Linux AMI (AL1) to retired. Expand each section that follows to read more about each retired platform branch and its migration path to the latest platform branch running on Amazon Linux 2 or Amazon Linux 2023 (recommended).

This platform branch can deploy a Docker image, described in a Dockerfile or a Dockerrun.aws.json v1 definition. This platform branch runs only one container for each instance. Its succeeding platform branches,Docker running on 64bit AL2023 and Docker running on 64bit Amazon Linux 2 support multiple Docker containers per instance.

We recommend that you create your environments with the newer and supported platform branch Docker running on 64bit AL2023. You can then migrate your application to the newly created environment. For more information about creating these environments, see Using the Docker platform branch. For more information about migration, see Migrating your Elastic Beanstalk Linux application to Amazon Linux 2023 or 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. If you're currently using this retired platform branch, we recommend that you migrate to the latest ECS Running on Amazon Linux 2023 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 2023.

In addition to the prior mentioned Docker platforms, there is also the Preconfigured Docker GlassFish platform branch that runs on the Amazon Linux AMI operating system (AL1).

This platform branch has been superseded by the platform branches Docker running on 64bit AL2023 and Docker running on 64bit Amazon Linux 2. For more information, see Deploying a GlassFish application to the Docker platform.