Menu
AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)

Single Container Docker Environments

Single container Docker environments can be launched from a Dockerfile (which describes an image to build), a Dockerrun.aws.json file (which specifies an image to use and additional Elastic Beanstalk configuration options), or both. These configuration files can be bundled with source code and deployed in a ZIP file.

Get started with one of the following example applications, or see Single Container Docker Configuration for details on authoring Docker configuration files for a single container environment.

To launch an environment (console)

  1. Open the Elastic Beanstalk console.

  2. Choose an application or create a new one.

  3. In the upper right corner, choose Create New Environment from the Actions menu.

  4. Choose between Web server and Worker environment types. You cannot change an environment's tier after creation.

  5. For Platform, choose the platform that matches the language used by your application.

    Note

    Elastic Beanstalk supports multiple configurations for most platforms listed. By default, the console selects the latest version of the language, web container or framework supported by Elastic Beanstalk. If your application requires an older version, choose Configure more options below.

  6. For App code, choose Upload.

  7. Choose Local file, choose Browse, and open the source bundle.

  8. Choose Upload.

  9. Choose Create environment.

For detailed instructions on configuring and using the EB CLI, see Configure the EB CLI and Managing Elastic Beanstalk Environments with the EB CLI.

Sample PHP Application

GitHub link: awslabs/eb-demo-php-simple-app

This sample is a PHP application that runs on a custom Ubuntu image defined in a Dockerfile.

The PHP sample application uses Amazon RDS. You may be charged for using these services. If you are a new customer, you can make use of the AWS Free Usage Tier. For more information about pricing, see the following:

Sample Python Application

GitHub link: awslabs/eb-py-flask-signup

This sample is a Python application that runs on a custom Ubuntu image defined in a Dockerfile. It also includes a Dockerrun.aws.json file that maps a storage volume on the container to a matching path on the host instance.

The Python sample application uses Amazon DynamoDB, Amazon SQS, and Amazon SNS. You may be charged for using these services. If you are a new customer, you can make use of the AWS Free Usage Tier. For more information about pricing, see the following:

Sample Dockerfile Application

This sample is a Dockerfile configured to download the game 2048 from GitHub and run it on nginx.

Copy and paste the example into a file named Dockerfile and upload it instead of a source bundle when creating the environment.

FROM ubuntu:12.04

RUN apt-get update
RUN apt-get install -y nginx zip curl

RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN curl -o /usr/share/nginx/www/master.zip -L https://codeload.github.com/gabrielecirulli/2048/zip/master
RUN cd /usr/share/nginx/www/ && unzip master.zip && mv 2048-master/* . && rm -rf 2048-master master.zip

EXPOSE 80

CMD ["/usr/sbin/nginx", "-c", "/etc/nginx/nginx.conf"]