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)
Open the Elastic Beanstalk console.
Choose an application or create a new one.
In the upper right corner, choose Create New Environment from the Actions menu.
Choose between Web server and Worker environment types. You cannot change an environment's tier after creation.
For Platform, choose the platform that matches the language used by your application.
For App code, choose Upload.
Choose Local file, choose Browse, and open the source bundle.
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
file that maps a storage volume on the container to a matching path on the host
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"]