SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Interstella 8888: Learn How to Use
Docker on AWS
H u b e r t C h e u n g , A W S S o l u t i o n s A r c h i t e c t
A n d y M u i , A W S S o l u t i o n s A r c h i t e c t
D a v i d K u o , A W S S o l u t i o n s A r c h i t e c t
C O N 2 0 9
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ABOUT ME
andymui@amazon.com
Solutions Architect
Three years at AWS
Based in Southern California
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT TO EXPECT
Overview Docker Containers
Amazon Elastic Container Registry (ECR)
Amazon Elastic Container Service (ECS)
Hands-on Lab
• Containerize an Application
• Deploy Docker Containers Using ECS/ECR
• Scale Containers with AWS Application Load Balancer (ALB)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THE PROBLEM
Different application stacks
Different hardware deployment
environments
How to run all applications
across different environments?
How to easily migrate from one
environment to another?
Static
website
Web
fronted
Background
workers
User DB
Analytics
DB
Queue
Dev VM
QA
Server
Single
Prod
Server
Onsite
Cluster
Public
Cloud
Develope
r laptop
Customer
Servers
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THE SOLUTION
Unit of software delivery
Lightweight, portable, consistent
Deploy and run everywhere
Deploy and run anything
Static
website
Web
fronted
Background
workers
User DB
Analytics
DB
Queue
Dev VM
QA
Server
Single
Prod
Server
Onsite
Cluster
Public
Cloud
Develope
r laptop
Customer
Servers
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
USE CASES
Consistent environment between development and production
Service-oriented architectures/microservices
Short-lived workflows
Isolated environments for testing
Batch processing
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CONTAINERs vs VMs
Server (Host)
Host OS
Hypervisor
Guest OS Guest OS Guest OS
Bins/Libs Bins/Libs Bins/Libs
App 1 App 2 App 3
VM
Server (Host)
Host OS
Docker
Bins/Libs Bins/Libs Bins/Libs
App 1 App 2 App 3
Container
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKER IMAGE
Read-only template
Used to launch container
Start with base image, additional
data/dependencies are layers added
on top
Union file system merges layers into
single image
Instructions stored in Dockerfile
bootfs
kernel
Base image
Image
Image
Container
References
parent
image
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKERFILE
FROM dockerfile/ubuntu
RUN 
add-apt-repository -y ppa:nginx/stable && 
apt-get update && 
apt-get install -y nginx && 
rm -rf /var/lib/apt/lists/* && 
echo "ndaemon off;" >> /etc/nginx/nginx.conf && 
chown -R www-data:www-data /var/lib/nginx
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs",
"/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
WORKDIR /etc/nginx
CMD ["nginx"]
EXPOSE 80
EXPOSE 443
Source: https://github.com/dockerfile/nginx
Pull base image
Install Nginx
Define mountable directories
Define working directory
Define default command
Expose ports
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKER IMAGE REGISTRY
Images stored in a registry
Amazon Elastic Container Registry (ECR)
• Fully managed
• Secure – encryption at rest, IAM integration
• Scalable and highly available
• Integrated with Amazon ECS and Docker CLI
DockerHub
• Public repository of images
• Provides private image storage
Amazon ECR
Docker Hub
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKER ARCHITECTURE
Docker daemon manages images, containers,
networks and volumes
Docker client (e.g. CLI) communicates with daemon
through a REST API
Sample Commands:
• docker build – build image from Dockerfile
• docker images – list images on Docker host
• docker run – run an image
• docker ps – list running containers
• docker stop – stop a running container
docker daemon
Docker Host
Container 1
Container 2
Container n
Ubuntu Image
Nginx Image
Custom Image
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DEPLOYING CONTAINERS
Server
Docker
Bins/Libs Bins/Libs
App2App1
Single host with one
or more containers
…easy…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DEPLOYING CONTAINERS
Server
Docker
Bins/Libs Bins/Libs
App2App1
Tens of hosts with
multiple containers
…challenge
accepted…
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DEPLOYING CONTAINERS
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Server
Docker
Bins/Libs Bins/Libs
App2App1
Hundreds of hosts with
thousands of containers
…OK, this is hard…
Amazon ECS
Swarm
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS
H i g h l y s c a l a b l e , h i g h p e r f o r m a n c e c o n t a i n e r m a n a g e m e n t
s e r v i c e t h a t s u p p o r t s D o c k e r c o n t a i n e r s a n d a l l o w s y o u t o
e a s i l y r u n a p p l i c a t i o n s o n a m a n a g e d c l u s t e r o f
A m a z o n E l a s t i c C o m p u t e C l o u d ( E C 2 ) i n s t a n c e s .
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS
EC2 INSTANCES
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container AGENT COMMUNICATION
SERVICE
Amazon
ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
Internet LOAD
BALANCER
LOAD
BALANCER
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS - CLUSTER
EC2 INSTANCES
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container AGENT COMMUNICATION
SERVICE
Amazon
ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
Internet LOAD
BALANCER
LOAD
BALANCER
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS - TASK
EC2 INSTANCES
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container AGENT COMMUNICATION
SERVICE
Amazon
ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
Internet LOAD
BALANCER
LOAD
BALANCER
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS - SERVICE
EC2 INSTANCES
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container AGENT COMMUNICATION
SERVICE
Amazon
ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
Internet LOAD
BALANCER
LOAD
BALANCER
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS – TASK DEFINITION
{
"containerDefinitions": [
{
"name": "wordpress",
"links": [ "mysql" ],
"image": "wordpress",
"essential": true,
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
} ],
"memory": 500,
"cpu": 10
},
{
"name": "mysql",
"image": "mysql",
"cpu": 10,
"memory": 500,
Instructions used by ECS to launch
containers
JSON template
Used to launch tasks and services
Maps to docker run parameters
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
HANDS-ON LAB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WELCOME TO INTERSTELLA 8888
Interstella 8888 is an intergalactic trading company that was
established to import and export rare resources in the universe.
Interstella was a thriving company but business has been
declining despite a booming economy. You and a few other
consultants have been brought on board to turn this around. Will
you be able to restore Interstella to its former glory?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
YOUR MISSION
Interstella 8888 operates a logistics platform to control the processing centers of
the two rare resources – iridium and magnesite. We need help deploying the
platform to the AWS cloud and would like to adopt containers as a part of the
move.
Lab 1: Containerize the Interstella logistics software
Lab 2: Deploy containers using Amazon ECR and Amazon ECS
Demand is on the rise, and our developers are working on a microservices
implementation to help us scale fulfillment. As a stop-gap, help us horizontally
scale the logistics platform.
Bonus Lab: Scale the logistics platform with an ALB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WORKSHOP ENVIRONMENT
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
Orders come into
the logistics
platform as HTTP
POST messages via
Amazon Simple
Notification Service
(Amazon SNS)
Amazon S3 hosts
web content and
utilities – API key
generator, order
subscription, order
dashboard
The logistics platform
communicates with an
order fulfillment API
running on Amazon
API Gateway. Order
data is stored in
Amazon DynamoDB
Amazon
CloudWatch
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 1
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
1. Construct a
Dockerfile on to build
a Docker image for
the logistic platform.
2. Run the container
using the Docker
client to confirm it’s
working as expected.
3. Push the Docker
image up to Amazon
ECR.
FULFILL
Amazon
CloudWatch
Amazon
ECR
Amazon
ECS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 2
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Construct an ECS task
definition referencing
the Docker image
pushed up to ECR
from lab 1 and
configuring logging
to Amazon
CloudWatch Logs.
2. Run the task and
confirm orders are
being processed.
FULFILL
Amazon
CloudWatch
LOGS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
BONUS LAB
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Create an Application
Load Balancer (ALB).
2. Create an ECS service
that ties in the ALB
for routing orders to
tasks and maintains a
desired task count.
FULFILL
Amazon
CloudWatch
LOGS
Application
Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LOGISTICS
AWS REGION: EU (Ireland)
INSTRUCTIONS:
http://interstella.trade/workshop1/
Raise your hand if you have any questions. High-five your neighbors, feel
free to team up or help each other out, and have fun!
Please fill out feedback forms once you are done! Feel free to email us
with comments/questions/feedback: aws-interstella-team@amazon.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THANK YOU!

More Related Content

What's hot

CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
Amazon Web Services
 
STG203_Get Rid of Tape and Modernize Backup with AWS
STG203_Get Rid of Tape and Modernize Backup with AWSSTG203_Get Rid of Tape and Modernize Backup with AWS
STG203_Get Rid of Tape and Modernize Backup with AWS
Amazon Web Services
 
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Amazon Web Services
 
Building Serverless Real-time Data Processing (workshop)
Building Serverless Real-time Data Processing (workshop)Building Serverless Real-time Data Processing (workshop)
Building Serverless Real-time Data Processing (workshop)
Amazon Web Services
 
DEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWSDEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWS
Amazon Web Services
 
MBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real WorldMBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real World
Amazon Web Services
 
CON307_Building Effective Container Images
CON307_Building Effective Container ImagesCON307_Building Effective Container Images
CON307_Building Effective Container Images
Amazon Web Services
 
SRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the EdgeSRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the Edge
Amazon Web Services
 
CON202-Getting Started with Docker and Amazon ECS
CON202-Getting Started with Docker and Amazon ECSCON202-Getting Started with Docker and Amazon ECS
CON202-Getting Started with Docker and Amazon ECS
Amazon Web Services
 
CON203_Driving Innovation with Containers
CON203_Driving Innovation with ContainersCON203_Driving Innovation with Containers
CON203_Driving Innovation with Containers
Amazon Web Services
 
DEV326_DevOps Essentials An Introductory Workshop on CICD Practices
DEV326_DevOps Essentials An Introductory Workshop on CICD PracticesDEV326_DevOps Essentials An Introductory Workshop on CICD Practices
DEV326_DevOps Essentials An Introductory Workshop on CICD Practices
Amazon Web Services
 
CMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web Services
CMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web ServicesCMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web Services
CMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web Services
Amazon Web Services
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL Performance
Amazon Web Services
 
ABD215_Serverless Data Prep with AWS Glue
ABD215_Serverless Data Prep with AWS GlueABD215_Serverless Data Prep with AWS Glue
ABD215_Serverless Data Prep with AWS Glue
Amazon Web Services
 
MCL306_Making IoT Smarter with AWS Rekognition.pdf
MCL306_Making IoT Smarter with AWS Rekognition.pdfMCL306_Making IoT Smarter with AWS Rekognition.pdf
MCL306_Making IoT Smarter with AWS Rekognition.pdf
Amazon Web Services
 
Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...
Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...
Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...
Amazon Web Services
 
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdfSRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
Amazon Web Services
 
GPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made EasyGPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made Easy
Amazon Web Services
 
IOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoTIOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoT
Amazon Web Services
 
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Amazon Web Services
 

What's hot (20)

CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
STG203_Get Rid of Tape and Modernize Backup with AWS
STG203_Get Rid of Tape and Modernize Backup with AWSSTG203_Get Rid of Tape and Modernize Backup with AWS
STG203_Get Rid of Tape and Modernize Backup with AWS
 
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
 
Building Serverless Real-time Data Processing (workshop)
Building Serverless Real-time Data Processing (workshop)Building Serverless Real-time Data Processing (workshop)
Building Serverless Real-time Data Processing (workshop)
 
DEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWSDEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWS
 
MBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real WorldMBL201_Progressive Web Apps in the Real World
MBL201_Progressive Web Apps in the Real World
 
CON307_Building Effective Container Images
CON307_Building Effective Container ImagesCON307_Building Effective Container Images
CON307_Building Effective Container Images
 
SRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the EdgeSRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the Edge
 
CON202-Getting Started with Docker and Amazon ECS
CON202-Getting Started with Docker and Amazon ECSCON202-Getting Started with Docker and Amazon ECS
CON202-Getting Started with Docker and Amazon ECS
 
CON203_Driving Innovation with Containers
CON203_Driving Innovation with ContainersCON203_Driving Innovation with Containers
CON203_Driving Innovation with Containers
 
DEV326_DevOps Essentials An Introductory Workshop on CICD Practices
DEV326_DevOps Essentials An Introductory Workshop on CICD PracticesDEV326_DevOps Essentials An Introductory Workshop on CICD Practices
DEV326_DevOps Essentials An Introductory Workshop on CICD Practices
 
CMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web Services
CMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web ServicesCMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web Services
CMP323_AWS Batch Easy & Efficient Batch Computing on Amazon Web Services
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL Performance
 
ABD215_Serverless Data Prep with AWS Glue
ABD215_Serverless Data Prep with AWS GlueABD215_Serverless Data Prep with AWS Glue
ABD215_Serverless Data Prep with AWS Glue
 
MCL306_Making IoT Smarter with AWS Rekognition.pdf
MCL306_Making IoT Smarter with AWS Rekognition.pdfMCL306_Making IoT Smarter with AWS Rekognition.pdf
MCL306_Making IoT Smarter with AWS Rekognition.pdf
 
Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...
Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...
Building a Photorealistic Real-Time 3D Configurator with Server-Side Renderin...
 
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdfSRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
SRV332_Building Serverless Real-Time Data Processing (Now with Unicorns!).pdf
 
GPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made EasyGPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made Easy
 
IOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoTIOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoT
 
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
 

Similar to CON209_Interstella 8888 Learn How to Use Docker on AWS

Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
Amazon Web Services
 
AWS 容器服務入門實務
AWS 容器服務入門實務AWS 容器服務入門實務
AWS 容器服務入門實務
Amazon Web Services
 
Driving Innovation with Containers - CON203 - re:Invent 2017
Driving Innovation with Containers - CON203 - re:Invent 2017Driving Innovation with Containers - CON203 - re:Invent 2017
Driving Innovation with Containers - CON203 - re:Invent 2017
Amazon Web Services
 
CON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSCON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWS
Amazon Web Services
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Amazon Web Services
 
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Amazon Web Services
 
Introducing Amazon Fargate
Introducing Amazon FargateIntroducing Amazon Fargate
Introducing Amazon Fargate
Amazon Web Services
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
Amazon Web Services
 
Building with Containers on AWS
Building with Containers on AWSBuilding with Containers on AWS
Building with Containers on AWS
Amazon Web Services
 
Introducing Amazon EKS
Introducing Amazon EKSIntroducing Amazon EKS
Introducing Amazon EKS
Amazon Web Services
 
Getting Started with Docker On AWS
Getting Started with Docker On AWSGetting Started with Docker On AWS
Getting Started with Docker On AWS
Amazon Web Services
 
Containers on AWS
Containers on AWSContainers on AWS
Containers on AWS
Amazon Web Services
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
Amazon Web Services
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Web Services
 
Building with Containers on AWS
Building with Containers on AWSBuilding with Containers on AWS
Building with Containers on AWS
Amazon Web Services
 
Running Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelRunning Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day Israel
Amazon Web Services
 
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateDeep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Amazon Web Services
 
Serverless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftServerless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up Loft
Amazon Web Services
 
Workshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdfWorkshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdf
Amazon Web Services
 
Interstella GTC Workshop
Interstella GTC WorkshopInterstella GTC Workshop
Interstella GTC Workshop
Amazon Web Services
 

Similar to CON209_Interstella 8888 Learn How to Use Docker on AWS (20)

Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
 
AWS 容器服務入門實務
AWS 容器服務入門實務AWS 容器服務入門實務
AWS 容器服務入門實務
 
Driving Innovation with Containers - CON203 - re:Invent 2017
Driving Innovation with Containers - CON203 - re:Invent 2017Driving Innovation with Containers - CON203 - re:Invent 2017
Driving Innovation with Containers - CON203 - re:Invent 2017
 
CON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSCON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWS
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
 
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
 
Introducing Amazon Fargate
Introducing Amazon FargateIntroducing Amazon Fargate
Introducing Amazon Fargate
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
 
Building with Containers on AWS
Building with Containers on AWSBuilding with Containers on AWS
Building with Containers on AWS
 
Introducing Amazon EKS
Introducing Amazon EKSIntroducing Amazon EKS
Introducing Amazon EKS
 
Getting Started with Docker On AWS
Getting Started with Docker On AWSGetting Started with Docker On AWS
Getting Started with Docker On AWS
 
Containers on AWS
Containers on AWSContainers on AWS
Containers on AWS
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)
 
Building with Containers on AWS
Building with Containers on AWSBuilding with Containers on AWS
Building with Containers on AWS
 
Running Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelRunning Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day Israel
 
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateDeep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
 
Serverless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftServerless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up Loft
 
Workshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdfWorkshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdf
 
Interstella GTC Workshop
Interstella GTC WorkshopInterstella GTC Workshop
Interstella GTC Workshop
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
Amazon Web Services
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
Amazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Amazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
Amazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Amazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

CON209_Interstella 8888 Learn How to Use Docker on AWS

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Interstella 8888: Learn How to Use Docker on AWS H u b e r t C h e u n g , A W S S o l u t i o n s A r c h i t e c t A n d y M u i , A W S S o l u t i o n s A r c h i t e c t D a v i d K u o , A W S S o l u t i o n s A r c h i t e c t C O N 2 0 9
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ABOUT ME andymui@amazon.com Solutions Architect Three years at AWS Based in Southern California
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT TO EXPECT Overview Docker Containers Amazon Elastic Container Registry (ECR) Amazon Elastic Container Service (ECS) Hands-on Lab • Containerize an Application • Deploy Docker Containers Using ECS/ECR • Scale Containers with AWS Application Load Balancer (ALB)
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THE PROBLEM Different application stacks Different hardware deployment environments How to run all applications across different environments? How to easily migrate from one environment to another? Static website Web fronted Background workers User DB Analytics DB Queue Dev VM QA Server Single Prod Server Onsite Cluster Public Cloud Develope r laptop Customer Servers
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THE SOLUTION Unit of software delivery Lightweight, portable, consistent Deploy and run everywhere Deploy and run anything Static website Web fronted Background workers User DB Analytics DB Queue Dev VM QA Server Single Prod Server Onsite Cluster Public Cloud Develope r laptop Customer Servers
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. USE CASES Consistent environment between development and production Service-oriented architectures/microservices Short-lived workflows Isolated environments for testing Batch processing
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CONTAINERs vs VMs Server (Host) Host OS Hypervisor Guest OS Guest OS Guest OS Bins/Libs Bins/Libs Bins/Libs App 1 App 2 App 3 VM Server (Host) Host OS Docker Bins/Libs Bins/Libs Bins/Libs App 1 App 2 App 3 Container
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKER IMAGE Read-only template Used to launch container Start with base image, additional data/dependencies are layers added on top Union file system merges layers into single image Instructions stored in Dockerfile bootfs kernel Base image Image Image Container References parent image
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKERFILE FROM dockerfile/ubuntu RUN add-apt-repository -y ppa:nginx/stable && apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* && echo "ndaemon off;" >> /etc/nginx/nginx.conf && chown -R www-data:www-data /var/lib/nginx VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] WORKDIR /etc/nginx CMD ["nginx"] EXPOSE 80 EXPOSE 443 Source: https://github.com/dockerfile/nginx Pull base image Install Nginx Define mountable directories Define working directory Define default command Expose ports
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKER IMAGE REGISTRY Images stored in a registry Amazon Elastic Container Registry (ECR) • Fully managed • Secure – encryption at rest, IAM integration • Scalable and highly available • Integrated with Amazon ECS and Docker CLI DockerHub • Public repository of images • Provides private image storage Amazon ECR Docker Hub
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKER ARCHITECTURE Docker daemon manages images, containers, networks and volumes Docker client (e.g. CLI) communicates with daemon through a REST API Sample Commands: • docker build – build image from Dockerfile • docker images – list images on Docker host • docker run – run an image • docker ps – list running containers • docker stop – stop a running container docker daemon Docker Host Container 1 Container 2 Container n Ubuntu Image Nginx Image Custom Image
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DEPLOYING CONTAINERS Server Docker Bins/Libs Bins/Libs App2App1 Single host with one or more containers …easy…
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DEPLOYING CONTAINERS Server Docker Bins/Libs Bins/Libs App2App1 Tens of hosts with multiple containers …challenge accepted… Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DEPLOYING CONTAINERS Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Server Docker Bins/Libs Bins/Libs App2App1 Hundreds of hosts with thousands of containers …OK, this is hard… Amazon ECS Swarm
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS H i g h l y s c a l a b l e , h i g h p e r f o r m a n c e c o n t a i n e r m a n a g e m e n t s e r v i c e t h a t s u p p o r t s D o c k e r c o n t a i n e r s a n d a l l o w s y o u t o e a s i l y r u n a p p l i c a t i o n s o n a m a n a g e d c l u s t e r o f A m a z o n E l a s t i c C o m p u t e C l o u d ( E C 2 ) i n s t a n c e s .
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS EC2 INSTANCES ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container Internet LOAD BALANCER LOAD BALANCER
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS - CLUSTER EC2 INSTANCES ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container Internet LOAD BALANCER LOAD BALANCER
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS - TASK EC2 INSTANCES ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container Internet LOAD BALANCER LOAD BALANCER
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS - SERVICE EC2 INSTANCES ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container Internet LOAD BALANCER LOAD BALANCER
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS – TASK DEFINITION { "containerDefinitions": [ { "name": "wordpress", "links": [ "mysql" ], "image": "wordpress", "essential": true, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "memory": 500, "cpu": 10 }, { "name": "mysql", "image": "mysql", "cpu": 10, "memory": 500, Instructions used by ECS to launch containers JSON template Used to launch tasks and services Maps to docker run parameters
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. HANDS-ON LAB
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WELCOME TO INTERSTELLA 8888 Interstella 8888 is an intergalactic trading company that was established to import and export rare resources in the universe. Interstella was a thriving company but business has been declining despite a booming economy. You and a few other consultants have been brought on board to turn this around. Will you be able to restore Interstella to its former glory?
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. YOUR MISSION Interstella 8888 operates a logistics platform to control the processing centers of the two rare resources – iridium and magnesite. We need help deploying the platform to the AWS cloud and would like to adopt containers as a part of the move. Lab 1: Containerize the Interstella logistics software Lab 2: Deploy containers using Amazon ECR and Amazon ECS Demand is on the rise, and our developers are working on a microservices implementation to help us scale fulfillment. As a stop-gap, help us horizontally scale the logistics platform. Bonus Lab: Scale the logistics platform with an ALB
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WORKSHOP ENVIRONMENT Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS Orders come into the logistics platform as HTTP POST messages via Amazon Simple Notification Service (Amazon SNS) Amazon S3 hosts web content and utilities – API key generator, order subscription, order dashboard The logistics platform communicates with an order fulfillment API running on Amazon API Gateway. Order data is stored in Amazon DynamoDB Amazon CloudWatch
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 1 Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB 1. Construct a Dockerfile on to build a Docker image for the logistic platform. 2. Run the container using the Docker client to confirm it’s working as expected. 3. Push the Docker image up to Amazon ECR. FULFILL Amazon CloudWatch Amazon ECR Amazon ECS
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 2 Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Construct an ECS task definition referencing the Docker image pushed up to ECR from lab 1 and configuring logging to Amazon CloudWatch Logs. 2. Run the task and confirm orders are being processed. FULFILL Amazon CloudWatch LOGS
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. BONUS LAB Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Create an Application Load Balancer (ALB). 2. Create an ECS service that ties in the ALB for routing orders to tasks and maintains a desired task count. FULFILL Amazon CloudWatch LOGS Application Load Balancer
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LOGISTICS AWS REGION: EU (Ireland) INSTRUCTIONS: http://interstella.trade/workshop1/ Raise your hand if you have any questions. High-five your neighbors, feel free to team up or help each other out, and have fun! Please fill out feedback forms once you are done! Feel free to email us with comments/questions/feedback: aws-interstella-team@amazon.com
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THANK YOU!