Berlin
CONTINUOUS
INTEGRATION
DEVELOPERS
INFRASTRUCTURE
DEVELOPERS
SOURCE CODE
REPOSITORY
INFRASTRUCTURE
DEVELOPERS
SOURCE CODE
REPOSITORY
PROJECT MANAGEMENT
SERVER
INFRASTRUCTURE
DEVELOPERS
SOURCE CODE
REPOSITORY
CONTINUOUS
INTEGRATION SERVERS
PROJECT MANAGEMENT
SERVER
INFRASTRUCTURE
DEVELOPERS
SOURCE CODE
REPOSITORY
CONTINUOUS
INTEGRATION SERVERS
PROJECT MANAGEMENT
SERVER
INFRASTRUCTURE
PICK
TASKS
DEVELOPERS
SOURCE CODE
REPOSITORY
CONTINUOUS
INTEGRATION SERVERS
PROJECT MANAGEMENT
SERVER
INFRASTRUCTURE
SUBMIT
CODE
DEVELOPERS
SOURCE CODE
REPOSITORY
CONTINUOUS
INTEGRATION SERVERS
PROJECT MANAGEMENT
SERVER
INFRASTRUCTURE
CODE
FETCH
DEVELOPERS
SOURCE CODE
REPOSITORY
CONTINUOUS
INTEGRATION SERVERS
PROJECT MANAGEMENT
SERVER
DOCS
BINARIES &
PACKAGES
INFRASTRUCTURE
BUILD OUTPUT
DEVELOPERS
SOURCE CODE
REPOSITORY
CONTINUOUS
INTEGRATION SERVERS
PROJECT MANAGEMENT
SERVER
DOCS
BINARIES &
PACKAGES
INFRASTRUCTURE
DEVELOPERS
DOCS
BINARIES &
PACKAGES
INFRASTRUCTURE?
= PROGRAMMABLE PLATFORM
IF YOU CAN PROGRAM IT,
YOU CAN AUTOMATE IT
Docker on AWS
Sascha Möllering, Senior Software Engineer, zanox AG
sascha242
What is zanox?
Simplified architecture
Title with free format content section
Shipping with Docker
Amazon Cloud
WorkstationGitHub
Jenkins
Python/Boto
Docker Image
Docker Registry S3 bucket with
Docker Images
Shipping with Docker
EC2 instance with Docker
registry (port 5000)
S3 bucket to store
Docker images
Shipping with Docker
Shipping with Docker
Shipping with Docker
• EC2 User Data
• Data to configure instance during launch– Install Docker
– Start Daemon
– Run Docker container
Immutable Server
Title with free format content section
Immutable Server
• Trash your servers!
• New deployment -> new infrastructure
• Don’t change an existing server
• Problem: snowflake server
Immutable Server
Title with free format content section
Immutable Server
Immutable Server
• Pre-Baking AMIs with Packer
• Security patches
• Configuration
• Additional software
CONTINUOUS
DEPLOYMENT
DEVELOPERS
CONTINUOUS
DEPLOYMENT SERVERS
BINARIES &
PACKAGES
INFRASTRUCTURE
DEPLOY
Elastic Beanstalk Cloudformation Code Deploy OpsWorks
EC2 Container Services
+
CLUSTER MANAGEMENT
FLEXIBLE CONTAINER
PLACEMENT
INTEGRATED WITH
OTHER SERVICES
EXTENSIBLE
PERFORMANCE AT SCALE
SECURITY FIRST
ANATOMY
OF AN ECS
DEPLOYMENT
DOCKER CONTAINERS
EC2 INSTANCES CLUSTER
TASK DEFINITIONS
[
{
"image": "tutum/wordpress-stackable",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"db"
],
"entryPoint": [
"/bin/sh",
"-c"
],
"environment": [
…
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
]
[
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
Tasks are defined via Task Definitions[
{
"image": "tutum/wordpress-stackable",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"db"
],
"entryPoint": [
"/bin/sh",
"-c"
],
"environment": [
…
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
]
[
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
From Dockerhub
10 CPU Units
(1024 is full CPU),
500 Megabytes of Memory
Environment Variables
No external ports exposed
[
{
"image": "tutum/wordpress-stackable",
"name": "wordpress",
"cpu": 10,
"memory": 500,
"essential": true,
"links": [
"db"
],
"entryPoint": [
"/bin/sh",
"-c"
],
"environment": [
…
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
]
},
]
[
{
"image": "mysql",
"name": "db",
"cpu": 10,
"memory": 500,
"essential": true,
"entryPoint": [
"/entrypoint.sh"
],
"environment": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "pass"
}
],
"portMappings": []
}
]
Essential to our Task
Docker link to mysql container
Expose port 80 in container
to port 80 on host
DEPLOYMENT TO ECS
register-task-definition
update-service
CONTINUOUS INTEGRATION
or
DEPLOYMENT SERVER
AWS SDK
or
AWS CLI
EC2 CONTAINER SERVICE
CONTINUOUS INTEGRATION
or
DEPLOYMENT SERVER
AWS SDK
or
AWS CLI
EC2 CONTAINER SERVICE
POST BUILD STEP API CALLS
DEMO
AWS CLOUD
JENKINS & AWS CLI
EC2
GITHUBSOURCE
ECS
DOCKER
REGISTRY
EC2 INSTANCES
CLUSTER
@sebsto