SlideShare a Scribd company logo
Paolo Latella
@LatellaPaolo
 Docker on Amazon Web Services
From Development to Production with ECS
Genesis - the right tools
http://www.simpsoncrazy.com/
http://www.simpsoncrazy.com/
Genesis - the right tools
Development - Docker
Docker Engine Docker Compose Docker Hub
Development - Docker compose
Using Compose is basically a three-step process:
1. Define your app’s environment with a Dockerfile so it can
be reproduced anywhere.
2. Define the services that make up your app in docker-
compose.yml so they can be run together in an isolated
environment.
3. Run docker-compose up and Compose will start and run
your entire app.
Development - Docker compose example
version: '2'
services:
web:
image: platella/python-yarw-1:blue
build: .
ports:
- "8080"
volumes:
- python-microservice-one/application:/code
cpu_shares: 128
mem_limit: 134217728
links:
- redis
redis:
image: "redis:alpine"
cpu_shares: 128
mem_limit: 134217728
ports:
- "6379"
Production - Docker on AWS
• Docker on Amazon Elastic Beanstalk
• Docker on Amazon EC2 Container Service (ECS)
• Elastic Container Registry
• Task & Services
• Docker Swarm on Elastic Compute Cloud (EC2)
AWS
CloudFormation
Production - Docker on Amazon EB
• Single Container Docker Environments
• Run one container per instance.
• Use a Dockerfile or Dockerrun.aws.json file
• Multi Container Docker Environments
• Use Elastic Container Services inside a Elastic Beanstalk
Environment
• Set of containers defined in a Dockerrun.aws.json file
Docker on Amazon EB - Single Container
We can deploy from a Docker to Elastic Beanstalk by doing
(OR)
• Create a Dockerfile to customize an image and to deploy a
Docker container to Elastic Beanstalk.
• Create a Dockerrun.aws.json file to deploy a Docker
container from an existing Docker image to Elastic Beanstalk.
• Create a .zip file containing your application files, any
application file dependencies, the Dockerfile, and the
Dockerrun.aws.json file.
Docker on Amazon EB - Single Container -
DockerfileFROM ubuntu:14.04
# Ubuntu and nodeJS for ElasticBeanstalk
# VERSION 0.0.1
FROM ubuntu:14.04
MAINTAINER Paolo Latella <paolo.latella@xpeppers.com>
#Port mapping
EXPOSE 8080
#Update and install nodejs
RUN apt-get update && apt-get install -y nodejs
#Copy files for nodejs application
RUN mkdir /var/www/
ADD myws.js /var/www/
#Start application
CMD /usr/bin/nodejs /var/www/myws.js
Docker on Amazon EB - Single Container -
Dockerrun{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "janedoe/image",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "1234"
}
],
"Volumes": [
{
"HostDirectory": "/var/app/mydb",
"ContainerDirectory": "/etc/mysql"
}
],
"Logging": "/var/log/nginx"
}.
Production - Amazon EC2 Container Service
Amazon ECR
Amazon Elastic Container Service - ecs-cli
ECS CLI Command Line
ecs-cli configure --region eu-west-1 --cluster Demo-ECSCluster
ecs-cli up --keypair key --capability-iam --size 4 --instance-type c4.large
ecs-cli compose -f python-microservice1/docker-compose.yml service create
ecs-cli compose -f python-microservice1/docker-compose.yml service start
ecs-cli compose -f python-microservice1/docker-compose.yml service scale 2
http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_reference.html
ECS CLI supports Docker compose file syntax versions 1 and 2
Amazon Elastic Container Service - aws ecs
AWS ECS Command Line
aws ecs create-cluster --region eu-west-1 --cluster-name “Demo-ECSCluster"
aws ecs register-task-definition --cli-input-json file://./python-yarw-1.json
aws ecs create-service --service-name python-yarw-1 --task-definition python-
yarw-1 --desired-count 2
aws ecs update-service --service python-yarw-1 --cluster Demo-ECSCluster --task-
definition python-yarw-1 --desired-count 4 --deployment-configuration
"maximumPercent=200,minimumHealthyPercent=100"
http://docs.aws.amazon.com/cli/latest/reference/ecs/index.html#cli-aws-ecs
Amazon Elastic Container Service - Task definition
(1/2){
"containerDefinitions": [
{
"memory": 128,
"portMappings": [
{
"hostPort": 0,
"containerPort": 6379,
"protocol": "tcp"
}
],
"name": "redis",
"image": "redis:alpine",
"cpu": 128,
},
Amazon Elastic Container Service - Task definition
(2/2){
"memory": 128,
"portMappings": [
{
"hostPort": 0,
"containerPort": 8080,
"protocol": "tcp"
}
],
"name": "web",
"links": [
"redis"
],
"cpu": 128,
}
],
"family": "ecscompose-python-microservice-one"
}
Amazon Elastic Container Service - Placement
aws ecs create-service --service-name python-yarw-1 --task-definition python-
yarw-1 --desired-count 2 --placement-strategy
type="spread",field="attribute:ecs.availability-zone"
type="binpack",field="memory"
Amazon Elastic Container Service - Load
Balanceraws ecs create-service --service-name python-yarw-1 --task-definition python-
yarw-1 --desired-count 2 --load-balancers
"targetGroupArn=arn:aws:elasticloadbalancing:eu-west-
1:831650818513:targetgroup/Microservices-
one/cca50273455ba775,containerName=web,containerPort=8080" --desired-count 2 --
deployment-configuration "maximumPercent=200,minimumHealthyPercent=50" --role
ECS-TestRole
Amazon Elastic Container Service - Blue/Green
Deploy
DNS Swap
1. Create new task definition
2. Create new service
3. Create new ALB
4. Attach new service to ALB
5. Update Route53
6. CleanUP Blue
Environment
Service Swap
1. Create new task definition
2. - Create new service
3. - Attach new service to
ALB
4. - Scale Up Green Service
5. - Scale Down Blue Service
Service Update
1. Create new task definition
2. Update the service
Amazon
CloudWatch
Production - CI/CD with ECS and CodePipeline
Code Build TestProvision Deploy Monitor
AWS
CodePipeline
AWS
CodeCommit
AWS
CodeBuild
AWS
Lambda
Amazon ECR
Amazon ECSAWS
CloudFormation
Amazon ECS
Demo - Steps
1. Create ECS Cluster and related resources
2. Creates an ECS task definition from your compose file
3. Create Service from task definition and attach to ALB
4. Scale task associated to services
5. Scale Cluster instances
6. Simulate Blue/Green deployment
Links
• https://martinfowler.com/bliki/MonolithFirst.html
• https://docs.docker.com/docker-for-aws/
• http://docs.aws.amazon.com/AmazonECS/latest/develo
perguide/ECS_CLI_reference.html
• http://docs.aws.amazon.com/cli/latest/reference/ecs/ind
ex.html#cli-aws-ecs
• https://github.com/ExpediaDotCom/c3vis
www.xpeppers.com
/xpepperssrl@xpeppers
@LatellaPaolo

More Related Content

What's hot

Aws tutorial for beginners- tibacademy.in
Aws tutorial for beginners- tibacademy.inAws tutorial for beginners- tibacademy.in
Aws tutorial for beginners- tibacademy.in
TIB Academy
 
"How to optimize the architecture of your platform" by Julien Simon
"How to optimize the architecture of your platform" by Julien Simon"How to optimize the architecture of your platform" by Julien Simon
"How to optimize the architecture of your platform" by Julien Simon
TheFamily
 
Aws cli
Aws cliAws cli
Aws cli
Anh Vu Pham
 
Agile Deployment using Git and AWS Elastic Beanstalk
Agile Deployment using Git and AWS Elastic BeanstalkAgile Deployment using Git and AWS Elastic Beanstalk
Agile Deployment using Git and AWS Elastic Beanstalk
Amazon Web Services
 
My First Big Data Application
My First Big Data ApplicationMy First Big Data Application
My First Big Data Application
Amazon Web Services
 
2017 AWSome day Taichung sharing
2017 AWSome day Taichung sharing2017 AWSome day Taichung sharing
2017 AWSome day Taichung sharing
Yu-Lin Huang
 
Building High-availability Websites on AWS
Building High-availability Websites on AWSBuilding High-availability Websites on AWS
Building High-availability Websites on AWSAmazon Web Services
 
AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)
Julien SIMON
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
Amazon Web Services
 
Amazon EC2 - Masterclass - Pop-up Loft Tel Aviv
Amazon EC2 - Masterclass - Pop-up Loft Tel AvivAmazon EC2 - Masterclass - Pop-up Loft Tel Aviv
Amazon EC2 - Masterclass - Pop-up Loft Tel Aviv
Amazon Web Services
 
Introduction to Amazon EC2 Spot Instances
Introduction to Amazon EC2 Spot InstancesIntroduction to Amazon EC2 Spot Instances
Introduction to Amazon EC2 Spot Instances
Amazon Web Services
 
Building Open Source Platforms on AWS (April 2017)
Building Open Source Platforms on AWS (April 2017)Building Open Source Platforms on AWS (April 2017)
Building Open Source Platforms on AWS (April 2017)
Julien SIMON
 
Amazon EC2 Masterclass
Amazon EC2 MasterclassAmazon EC2 Masterclass
Amazon EC2 Masterclass
Amazon Web Services
 
Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...
Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...
Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...
Amazon Web Services
 
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWSAWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
Amazon Web Services
 
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows ServerAWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
Amazon Web Services
 
Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)
Julien SIMON
 
The History of AWS EC2
The History of AWS EC2The History of AWS EC2
The History of AWS EC2
CloudMachineManager
 
Understanding The Benefits Of Amazon EC2
Understanding The Benefits Of Amazon EC2Understanding The Benefits Of Amazon EC2
Understanding The Benefits Of Amazon EC2
Intelligentia IT Systems Pvt. Ltd.
 
AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...
AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...
AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...
Amazon Web Services
 

What's hot (20)

Aws tutorial for beginners- tibacademy.in
Aws tutorial for beginners- tibacademy.inAws tutorial for beginners- tibacademy.in
Aws tutorial for beginners- tibacademy.in
 
"How to optimize the architecture of your platform" by Julien Simon
"How to optimize the architecture of your platform" by Julien Simon"How to optimize the architecture of your platform" by Julien Simon
"How to optimize the architecture of your platform" by Julien Simon
 
Aws cli
Aws cliAws cli
Aws cli
 
Agile Deployment using Git and AWS Elastic Beanstalk
Agile Deployment using Git and AWS Elastic BeanstalkAgile Deployment using Git and AWS Elastic Beanstalk
Agile Deployment using Git and AWS Elastic Beanstalk
 
My First Big Data Application
My First Big Data ApplicationMy First Big Data Application
My First Big Data Application
 
2017 AWSome day Taichung sharing
2017 AWSome day Taichung sharing2017 AWSome day Taichung sharing
2017 AWSome day Taichung sharing
 
Building High-availability Websites on AWS
Building High-availability Websites on AWSBuilding High-availability Websites on AWS
Building High-availability Websites on AWS
 
AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Amazon EC2 - Masterclass - Pop-up Loft Tel Aviv
Amazon EC2 - Masterclass - Pop-up Loft Tel AvivAmazon EC2 - Masterclass - Pop-up Loft Tel Aviv
Amazon EC2 - Masterclass - Pop-up Loft Tel Aviv
 
Introduction to Amazon EC2 Spot Instances
Introduction to Amazon EC2 Spot InstancesIntroduction to Amazon EC2 Spot Instances
Introduction to Amazon EC2 Spot Instances
 
Building Open Source Platforms on AWS (April 2017)
Building Open Source Platforms on AWS (April 2017)Building Open Source Platforms on AWS (April 2017)
Building Open Source Platforms on AWS (April 2017)
 
Amazon EC2 Masterclass
Amazon EC2 MasterclassAmazon EC2 Masterclass
Amazon EC2 Masterclass
 
Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...
Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...
Module 2: AWS Infrastructure – Compute, Storage and Networking - AWSome Day O...
 
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWSAWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
 
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows ServerAWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
AWS July Webinar Series: Introducing AWS OpsWorks for Windows Server
 
Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)Deep Dive: Amazon Relational Database Service (March 2017)
Deep Dive: Amazon Relational Database Service (March 2017)
 
The History of AWS EC2
The History of AWS EC2The History of AWS EC2
The History of AWS EC2
 
Understanding The Benefits Of Amazon EC2
Understanding The Benefits Of Amazon EC2Understanding The Benefits Of Amazon EC2
Understanding The Benefits Of Amazon EC2
 
AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...
AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...
AWS re:Invent 2016: Workshop: Deploy a Deep Learning Framework on Amazon ECS ...
 

Similar to Amazon Web Services and Docker: from developing to production

Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016
Robert Lemke
 
Docker
DockerDocker
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016
Patrick Chanezon
 
0507 057 01 98 * Adana Klima Tamir Servisi
0507 057 01 98 * Adana Klima Tamir Servisi0507 057 01 98 * Adana Klima Tamir Servisi
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
Docker, Inc.
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
Aptible
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
nirajrules
 
Using the Azure Container Service in your company
Using the Azure Container Service in your companyUsing the Azure Container Service in your company
Using the Azure Container Service in your company
Jan de Vries
 
Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016
Patrick Chanezon
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon Web Services
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
Ezequiel Maraschio
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
Dmitry Lyfar
 
What Is AWS Elastic Kubernetes Service
 What Is AWS Elastic Kubernetes Service What Is AWS Elastic Kubernetes Service
What Is AWS Elastic Kubernetes Service
AMELIAOLIVIA2
 
Amazon EC2 Container Service
Amazon EC2 Container ServiceAmazon EC2 Container Service
Amazon EC2 Container Service
Amazon Web Services
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
Jérôme Petazzoni
 
EC2 Container Service
EC2 Container ServiceEC2 Container Service
EC2 Container Service
WhiteHedge Technologies Inc.
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang Bo
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 Cloud-native applications with Java and Kubernetes - Yehor Volkov Cloud-native applications with Java and Kubernetes - Yehor Volkov
Cloud-native applications with Java and Kubernetes - Yehor Volkov
Kuberton
 

Similar to Amazon Web Services and Docker: from developing to production (20)

Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016
 
Docker
DockerDocker
Docker
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016
 
0507 057 01 98 * Adana Klima Tamir Servisi
0507 057 01 98 * Adana Klima Tamir Servisi0507 057 01 98 * Adana Klima Tamir Servisi
0507 057 01 98 * Adana Klima Tamir Servisi
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Using the Azure Container Service in your company
Using the Azure Container Service in your companyUsing the Azure Container Service in your company
Using the Azure Container Service in your company
 
Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016Docker Container As A Service - Mix-IT 2016
Docker Container As A Service - Mix-IT 2016
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
What Is AWS Elastic Kubernetes Service
 What Is AWS Elastic Kubernetes Service What Is AWS Elastic Kubernetes Service
What Is AWS Elastic Kubernetes Service
 
Amazon EC2 Container Service
Amazon EC2 Container ServiceAmazon EC2 Container Service
Amazon EC2 Container Service
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
EC2 Container Service
EC2 Container ServiceEC2 Container Service
EC2 Container Service
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
 
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 Cloud-native applications with Java and Kubernetes - Yehor Volkov Cloud-native applications with Java and Kubernetes - Yehor Volkov
Cloud-native applications with Java and Kubernetes - Yehor Volkov
 

More from Paolo latella

XPeppers e AWS
XPeppers e AWSXPeppers e AWS
XPeppers e AWS
Paolo latella
 
Data Analysis on AWS
Data Analysis on AWSData Analysis on AWS
Data Analysis on AWS
Paolo latella
 
Amazon Web Services and Docker
Amazon Web Services and DockerAmazon Web Services and Docker
Amazon Web Services and Docker
Paolo latella
 
Hybrid Cloud With AWS and Eucalyptus
Hybrid Cloud With AWS and EucalyptusHybrid Cloud With AWS and Eucalyptus
Hybrid Cloud With AWS and Eucalyptus
Paolo latella
 
Mobile app and disaster recovery with aws
Mobile app and disaster recovery with awsMobile app and disaster recovery with aws
Mobile app and disaster recovery with awsPaolo latella
 
Cloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web ServicesCloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web ServicesPaolo latella
 
Amazon Web Services and Interact - Workshop Giugno 2013
Amazon Web Services and Interact - Workshop Giugno 2013Amazon Web Services and Interact - Workshop Giugno 2013
Amazon Web Services and Interact - Workshop Giugno 2013
Paolo latella
 

More from Paolo latella (8)

XPeppers e AWS
XPeppers e AWSXPeppers e AWS
XPeppers e AWS
 
AWSUGIT-Promo
AWSUGIT-PromoAWSUGIT-Promo
AWSUGIT-Promo
 
Data Analysis on AWS
Data Analysis on AWSData Analysis on AWS
Data Analysis on AWS
 
Amazon Web Services and Docker
Amazon Web Services and DockerAmazon Web Services and Docker
Amazon Web Services and Docker
 
Hybrid Cloud With AWS and Eucalyptus
Hybrid Cloud With AWS and EucalyptusHybrid Cloud With AWS and Eucalyptus
Hybrid Cloud With AWS and Eucalyptus
 
Mobile app and disaster recovery with aws
Mobile app and disaster recovery with awsMobile app and disaster recovery with aws
Mobile app and disaster recovery with aws
 
Cloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web ServicesCloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web Services
 
Amazon Web Services and Interact - Workshop Giugno 2013
Amazon Web Services and Interact - Workshop Giugno 2013Amazon Web Services and Interact - Workshop Giugno 2013
Amazon Web Services and Interact - Workshop Giugno 2013
 

Recently uploaded

20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 

Recently uploaded (20)

20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 

Amazon Web Services and Docker: from developing to production

  • 1. Paolo Latella @LatellaPaolo Docker on Amazon Web Services From Development to Production with ECS
  • 2. Genesis - the right tools http://www.simpsoncrazy.com/
  • 4. Development - Docker Docker Engine Docker Compose Docker Hub
  • 5. Development - Docker compose Using Compose is basically a three-step process: 1. Define your app’s environment with a Dockerfile so it can be reproduced anywhere. 2. Define the services that make up your app in docker- compose.yml so they can be run together in an isolated environment. 3. Run docker-compose up and Compose will start and run your entire app.
  • 6. Development - Docker compose example version: '2' services: web: image: platella/python-yarw-1:blue build: . ports: - "8080" volumes: - python-microservice-one/application:/code cpu_shares: 128 mem_limit: 134217728 links: - redis redis: image: "redis:alpine" cpu_shares: 128 mem_limit: 134217728 ports: - "6379"
  • 7. Production - Docker on AWS • Docker on Amazon Elastic Beanstalk • Docker on Amazon EC2 Container Service (ECS) • Elastic Container Registry • Task & Services • Docker Swarm on Elastic Compute Cloud (EC2) AWS CloudFormation
  • 8. Production - Docker on Amazon EB • Single Container Docker Environments • Run one container per instance. • Use a Dockerfile or Dockerrun.aws.json file • Multi Container Docker Environments • Use Elastic Container Services inside a Elastic Beanstalk Environment • Set of containers defined in a Dockerrun.aws.json file
  • 9. Docker on Amazon EB - Single Container We can deploy from a Docker to Elastic Beanstalk by doing (OR) • Create a Dockerfile to customize an image and to deploy a Docker container to Elastic Beanstalk. • Create a Dockerrun.aws.json file to deploy a Docker container from an existing Docker image to Elastic Beanstalk. • Create a .zip file containing your application files, any application file dependencies, the Dockerfile, and the Dockerrun.aws.json file.
  • 10. Docker on Amazon EB - Single Container - DockerfileFROM ubuntu:14.04 # Ubuntu and nodeJS for ElasticBeanstalk # VERSION 0.0.1 FROM ubuntu:14.04 MAINTAINER Paolo Latella <paolo.latella@xpeppers.com> #Port mapping EXPOSE 8080 #Update and install nodejs RUN apt-get update && apt-get install -y nodejs #Copy files for nodejs application RUN mkdir /var/www/ ADD myws.js /var/www/ #Start application CMD /usr/bin/nodejs /var/www/myws.js
  • 11. Docker on Amazon EB - Single Container - Dockerrun{ "AWSEBDockerrunVersion": "1", "Image": { "Name": "janedoe/image", "Update": "true" }, "Ports": [ { "ContainerPort": "1234" } ], "Volumes": [ { "HostDirectory": "/var/app/mydb", "ContainerDirectory": "/etc/mysql" } ], "Logging": "/var/log/nginx" }.
  • 12. Production - Amazon EC2 Container Service Amazon ECR
  • 13. Amazon Elastic Container Service - ecs-cli ECS CLI Command Line ecs-cli configure --region eu-west-1 --cluster Demo-ECSCluster ecs-cli up --keypair key --capability-iam --size 4 --instance-type c4.large ecs-cli compose -f python-microservice1/docker-compose.yml service create ecs-cli compose -f python-microservice1/docker-compose.yml service start ecs-cli compose -f python-microservice1/docker-compose.yml service scale 2 http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_reference.html ECS CLI supports Docker compose file syntax versions 1 and 2
  • 14. Amazon Elastic Container Service - aws ecs AWS ECS Command Line aws ecs create-cluster --region eu-west-1 --cluster-name “Demo-ECSCluster" aws ecs register-task-definition --cli-input-json file://./python-yarw-1.json aws ecs create-service --service-name python-yarw-1 --task-definition python- yarw-1 --desired-count 2 aws ecs update-service --service python-yarw-1 --cluster Demo-ECSCluster --task- definition python-yarw-1 --desired-count 4 --deployment-configuration "maximumPercent=200,minimumHealthyPercent=100" http://docs.aws.amazon.com/cli/latest/reference/ecs/index.html#cli-aws-ecs
  • 15. Amazon Elastic Container Service - Task definition (1/2){ "containerDefinitions": [ { "memory": 128, "portMappings": [ { "hostPort": 0, "containerPort": 6379, "protocol": "tcp" } ], "name": "redis", "image": "redis:alpine", "cpu": 128, },
  • 16. Amazon Elastic Container Service - Task definition (2/2){ "memory": 128, "portMappings": [ { "hostPort": 0, "containerPort": 8080, "protocol": "tcp" } ], "name": "web", "links": [ "redis" ], "cpu": 128, } ], "family": "ecscompose-python-microservice-one" }
  • 17. Amazon Elastic Container Service - Placement aws ecs create-service --service-name python-yarw-1 --task-definition python- yarw-1 --desired-count 2 --placement-strategy type="spread",field="attribute:ecs.availability-zone" type="binpack",field="memory"
  • 18. Amazon Elastic Container Service - Load Balanceraws ecs create-service --service-name python-yarw-1 --task-definition python- yarw-1 --desired-count 2 --load-balancers "targetGroupArn=arn:aws:elasticloadbalancing:eu-west- 1:831650818513:targetgroup/Microservices- one/cca50273455ba775,containerName=web,containerPort=8080" --desired-count 2 -- deployment-configuration "maximumPercent=200,minimumHealthyPercent=50" --role ECS-TestRole
  • 19. Amazon Elastic Container Service - Blue/Green Deploy DNS Swap 1. Create new task definition 2. Create new service 3. Create new ALB 4. Attach new service to ALB 5. Update Route53 6. CleanUP Blue Environment Service Swap 1. Create new task definition 2. - Create new service 3. - Attach new service to ALB 4. - Scale Up Green Service 5. - Scale Down Blue Service Service Update 1. Create new task definition 2. Update the service
  • 20. Amazon CloudWatch Production - CI/CD with ECS and CodePipeline Code Build TestProvision Deploy Monitor AWS CodePipeline AWS CodeCommit AWS CodeBuild AWS Lambda Amazon ECR Amazon ECSAWS CloudFormation Amazon ECS
  • 21. Demo - Steps 1. Create ECS Cluster and related resources 2. Creates an ECS task definition from your compose file 3. Create Service from task definition and attach to ALB 4. Scale task associated to services 5. Scale Cluster instances 6. Simulate Blue/Green deployment
  • 22. Links • https://martinfowler.com/bliki/MonolithFirst.html • https://docs.docker.com/docker-for-aws/ • http://docs.aws.amazon.com/AmazonECS/latest/develo perguide/ECS_CLI_reference.html • http://docs.aws.amazon.com/cli/latest/reference/ecs/ind ex.html#cli-aws-ecs • https://github.com/ExpediaDotCom/c3vis

Editor's Notes

  1. Using Compose is basically a three-step process. Define your app’s environment with a Dockerfile so it can be reproduced anywhere. Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment. Lastly, run docker-compose up and Compose will start and run your entire app.
  2. https://aws.amazon.com/blogs/developer/credentials-best-practices/