SlideShare a Scribd company logo
Dockerizing & Orchestrating
a Flask Application on Elastic
Beanstalk
Arnold Okoth - Andela
What is Docker?
● Application containerization platform.
○ Package. Run Isolated. Shared OS.
● Eases application deployment.
● Uniform environment across multiple computers.
● Benefits:
○ Development teams run applications on identical environments.
○ Isolates applications dependencies from OS dependencies.
Docker workflow
● The Docker workflow can be summarized as follows:
Docker workflow continued...
● Dockerfile: Creates a repeatable and portable way of building a Docker image. It is passed
to the `docker build` command to create an image.
● Image: An image is an inert, immutable file that is essentially a snapshot of a container.
● Container: A container is a running image. The image is passed to the `docker run` with
different options to create a running instance of the image.
Demo Application
● Really basic flask web application with 2 routes.
○ `/`
○ `/hello/<string:name>`
● Walkthrough existing Dockerfile
● Build & run image.
The Dockerfile
Dockerfile Directives
● FROM: This directive initializes a new build stage and sets the base image for subsequent
instructions.
● RUN: Execute any command in a new layer on top of the current image and commit the
results.
● COPY: Copies files or directories from source (first argument) and adds them to the file
system of the container at the destination path (second argument).
● WORKDIR: Sets the working directory for any directive that follows it in the Dockerfile.
● ENTRYPOINT: Allows you to configure a container that will run as an executable. In our
case we run our application.
The Image
● As depicted on our Docker workflow chart, the image comes about as a result of instructing
the Docker engine to build the contents of our Dockerfile.
● This is accomplished using the `docker build` command.
The Container
● The container is a running image. We achieve this by passing the image we built to `docker
run` command.
Elastic Beanstalk
● Service that allows quick deployment and easy management of applications on AWS.
● It allows developers to upload an application while it automatically handles capacity
provisioning, load balancing, monitoring and scaling.
● Elastic Beanstalk leverages different services on AWS e.g. S3, Elastic Load Balancing,
CloudWatch etc. and there are no extra costs incurred when using EB.
● There are numerous ways of interacting with EB i.e. Amazon Web Console, EB CLI & the
API. We will be using the EB CLI and the Amazon Web Console in the demo.
EB Application
● Elastic Beanstalk is made up of different components that work together to enable you to
easily manage and deploy your application. The first component is the application.
● An application is a logical collection of EB components including environments, versions
and environment configurations.
● To create an application we run: `eb init`
Dockerrun.aws.json
● A Dockerrun.aws.json file describes how to deploy a Docker container as an Elastic
Beanstalk application. This JSON file is specific to Elastic Beanstalk.
NB: There are certain rules to using this file as specified in the official documentation. One that
stood out was this; “When you provide both files i.e. Dockerfile and Dockerrun.aws.json, do not
specify an image in the Dockerrun.aws.json file. Elastic Beanstalk builds and uses the image
described in the Dockerfile and ignores the image specified in the Dockerrun.aws.json file”
EB Environment
● An environment is a version that is deployed onto AWS resources.
● Each environment runs only a single application version at a time, however you can run the
same version or different versions in many environments at the same time.
● When you create an environment, Elastic Beanstalk provisions the resources needed to run
the application version you specified. An application version refers to a specific, labeled
iteration of deployable code for a web application.
● We create an environment using: `eb create`
Q & A.
arnold.okoth@andela.com
https://github.com/arnoldokoth

More Related Content

PPTX
AWS ECS Meetup Talentica
PDF
Docker Fundamentals
PPTX
Docker Compose: Docker Configuration for the Real World
PDF
Build & Deploy Multi-Container Applications to AWS
PPTX
Intro to docker
PDF
Introduction to Docker Compose | Docker Intermediate Workshop
PDF
PDF
Introduction to Docker Compose
AWS ECS Meetup Talentica
Docker Fundamentals
Docker Compose: Docker Configuration for the Real World
Build & Deploy Multi-Container Applications to AWS
Intro to docker
Introduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose

What's hot (20)

PPTX
Docker - fundamental
PDF
Docker compose and swarm
PDF
Docker introduction - Part 1
PPTX
Docker introduction
PPTX
Introduction to Dockers and containers
PDF
JOSA TechTalks - Docker in Production
PPTX
Docker Global Hack Day #3
PPTX
Docker Platform 1.9
PPTX
Introduction to Docker
PPT
OpenStack with-docker-team-17
PPTX
Docker for .NET Developers
PPTX
Docker for .NET Developers
PDF
Docker with Selenium by Thirumalai Vignesh
PPTX
Docker basics
PPTX
Docker lightning
PPTX
Introduction to Docker - Getting Started with Docker
ODP
Docker Basics
PPTX
Docker introduction
PDF
Docker mentorweek
PDF
Docker get started
Docker - fundamental
Docker compose and swarm
Docker introduction - Part 1
Docker introduction
Introduction to Dockers and containers
JOSA TechTalks - Docker in Production
Docker Global Hack Day #3
Docker Platform 1.9
Introduction to Docker
OpenStack with-docker-team-17
Docker for .NET Developers
Docker for .NET Developers
Docker with Selenium by Thirumalai Vignesh
Docker basics
Docker lightning
Introduction to Docker - Getting Started with Docker
Docker Basics
Docker introduction
Docker mentorweek
Docker get started
Ad

Similar to Py Con 2017 (20)

PDF
PDF
[@NaukriEngineering] Docker 101
PDF
Rome .NET Conference 2024 - Remote Conference
PDF
Let's dockerize
PDF
Docker and Springboot by Clavrit Digital Solutions
PPTX
Getting Started With Docker: Simplifying DevOps
PDF
Docker slides
PPTX
Docker complete presentation related to all
PDF
Docker primer and tips
PPTX
Docker, LinuX Container
PPTX
Build Once, Run Anywhere: The Rise of Containerization in Modern IT
PPTX
Academy PRO: Docker. Part 2
PPTX
PDF
Up and running with docker
PDF
PPTX
Introduction to Containers & Diving a little deeper into the benefits of Con...
PDF
Docker image vs Docker Container: Understanding the difference
PDF
docker.pdf
PDF
Lecture eight to be introduced in class.
PDF
Docker dev ops for cd meetup 12-14
[@NaukriEngineering] Docker 101
Rome .NET Conference 2024 - Remote Conference
Let's dockerize
Docker and Springboot by Clavrit Digital Solutions
Getting Started With Docker: Simplifying DevOps
Docker slides
Docker complete presentation related to all
Docker primer and tips
Docker, LinuX Container
Build Once, Run Anywhere: The Rise of Containerization in Modern IT
Academy PRO: Docker. Part 2
Up and running with docker
Introduction to Containers & Diving a little deeper into the benefits of Con...
Docker image vs Docker Container: Understanding the difference
docker.pdf
Lecture eight to be introduced in class.
Docker dev ops for cd meetup 12-14
Ad

Recently uploaded (20)

PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Cost to Outsource Software Development in 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
medical staffing services at VALiNTRY
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Understanding Forklifts - TECH EHS Solution
Design an Analysis of Algorithms I-SECS-1021-03
Odoo Companies in India – Driving Business Transformation.pdf
Reimagine Home Health with the Power of Agentic AI​
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Designing Intelligence for the Shop Floor.pdf
Cost to Outsource Software Development in 2025
Wondershare Filmora 15 Crack With Activation Key [2025
How to Choose the Right IT Partner for Your Business in Malaysia
L1 - Introduction to python Backend.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
medical staffing services at VALiNTRY
Odoo POS Development Services by CandidRoot Solutions
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Understanding Forklifts - TECH EHS Solution

Py Con 2017

  • 1. Dockerizing & Orchestrating a Flask Application on Elastic Beanstalk Arnold Okoth - Andela
  • 2. What is Docker? ● Application containerization platform. ○ Package. Run Isolated. Shared OS. ● Eases application deployment. ● Uniform environment across multiple computers. ● Benefits: ○ Development teams run applications on identical environments. ○ Isolates applications dependencies from OS dependencies.
  • 3. Docker workflow ● The Docker workflow can be summarized as follows:
  • 4. Docker workflow continued... ● Dockerfile: Creates a repeatable and portable way of building a Docker image. It is passed to the `docker build` command to create an image. ● Image: An image is an inert, immutable file that is essentially a snapshot of a container. ● Container: A container is a running image. The image is passed to the `docker run` with different options to create a running instance of the image.
  • 5. Demo Application ● Really basic flask web application with 2 routes. ○ `/` ○ `/hello/<string:name>` ● Walkthrough existing Dockerfile ● Build & run image.
  • 7. Dockerfile Directives ● FROM: This directive initializes a new build stage and sets the base image for subsequent instructions. ● RUN: Execute any command in a new layer on top of the current image and commit the results. ● COPY: Copies files or directories from source (first argument) and adds them to the file system of the container at the destination path (second argument). ● WORKDIR: Sets the working directory for any directive that follows it in the Dockerfile. ● ENTRYPOINT: Allows you to configure a container that will run as an executable. In our case we run our application.
  • 8. The Image ● As depicted on our Docker workflow chart, the image comes about as a result of instructing the Docker engine to build the contents of our Dockerfile. ● This is accomplished using the `docker build` command.
  • 9. The Container ● The container is a running image. We achieve this by passing the image we built to `docker run` command.
  • 10. Elastic Beanstalk ● Service that allows quick deployment and easy management of applications on AWS. ● It allows developers to upload an application while it automatically handles capacity provisioning, load balancing, monitoring and scaling. ● Elastic Beanstalk leverages different services on AWS e.g. S3, Elastic Load Balancing, CloudWatch etc. and there are no extra costs incurred when using EB. ● There are numerous ways of interacting with EB i.e. Amazon Web Console, EB CLI & the API. We will be using the EB CLI and the Amazon Web Console in the demo.
  • 11. EB Application ● Elastic Beanstalk is made up of different components that work together to enable you to easily manage and deploy your application. The first component is the application. ● An application is a logical collection of EB components including environments, versions and environment configurations. ● To create an application we run: `eb init`
  • 12. Dockerrun.aws.json ● A Dockerrun.aws.json file describes how to deploy a Docker container as an Elastic Beanstalk application. This JSON file is specific to Elastic Beanstalk. NB: There are certain rules to using this file as specified in the official documentation. One that stood out was this; “When you provide both files i.e. Dockerfile and Dockerrun.aws.json, do not specify an image in the Dockerrun.aws.json file. Elastic Beanstalk builds and uses the image described in the Dockerfile and ignores the image specified in the Dockerrun.aws.json file”
  • 13. EB Environment ● An environment is a version that is deployed onto AWS resources. ● Each environment runs only a single application version at a time, however you can run the same version or different versions in many environments at the same time. ● When you create an environment, Elastic Beanstalk provisions the resources needed to run the application version you specified. An application version refers to a specific, labeled iteration of deployable code for a web application. ● We create an environment using: `eb create`

Editor's Notes

  • #3: Official Docker Website: https://www.docker.com/what-docker Containers are a way to package software in a format that can run isolated on a shared operating system. Unlike VMs, containers do not bundle a full operating system - only libraries and settings required to make the software work are needed. This makes for efficient, lightweight, self-contained systems and guarantees that software will always run the same, regardless of where it’s deployed.
  • #8: Official Dockerfile Reference: https://docs.docker.com/engine/reference/builder/
  • #13: Dockerrun Documentation: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_image.html