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
Ad

More Related Content

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
Robert Lemke
 
Docker
DockerDocker
Docker
Vitaly Tsaplin
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
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
Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisleri
 
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
 
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
 
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
 
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
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
Ben Hall
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016
Robert Lemke
 
[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
 
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
 
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
 
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
 
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
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
Ben Hall
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 

More from Paolo latella (8)

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 aws
Paolo latella
 
Cloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web ServicesCloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web Services
Paolo 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
 
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 aws
Paolo latella
 
Cloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web ServicesCloud Transcoding with Amazon Web Services
Cloud Transcoding with Amazon Web Services
Paolo 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
 
Ad

Recently uploaded (20)

Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Ad

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 <[email protected]> #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

  • #6: 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.
  • #23: https://aws.amazon.com/blogs/developer/credentials-best-practices/