This document outlines best practices for using containers in a continuous delivery pipeline. It recommends using containers with tools like Docker, Docker Compose, Amazon ECS, Jenkins, and AWS CodePipeline to build, test, and deploy applications. The workflow involves developing code in a source code repository, building Docker images, running tests inside containers, and deploying containers to production using Amazon ECS and AWS services for automation and orchestration of the pipeline. Demo applications and architectures are presented to illustrate container-based continuous delivery.
11. Docker and Docker Toolbox
• Docker (Linux > 3.10) or Docker Toolbox (OS X,
Windows)
• Define app environment with Dockerfile
12. Dockerfile
FROM ruby:2.2.2
RUN apt-get update -qq && apt-get install -y build-
essential libpq-dev
RUN mkdir -p /opt/web
WORKDIR /tmp
ADD Gemfile /tmp/
ADD Gemfile.lock /tmp/
RUN bundle install
ADD . /opt/web
WORKDIR /opt/web
13. Docker Compose
Define and run multi-container applications:
1. Define app environment with Dockerfile
2. Define services that make up your app in docker-
compose.yml
3. Run docker-compose up to start and run entire app
26. rspec and capybara-webkit
require 'rails_helper.rb'
feature 'Signing in' do
scenario 'can sign in' do
visit '/users/sign_in'
within("#new_user") do
fill_in 'Email', :with => 'test@test.com'
fill_in 'Password', :with => 'password'
end
click_button 'Log in'
expect(page).to have_content('Signed in successfully.')
end
end
27. Jenkins
• Run tests directly via Docker run
• Run tests in a Docker slave on Amazon ECS
35. AWS Elastic Beanstalk
• Deploy and manage applications without worrying about
the infrastructure
• AWS Elastic Beanstalk manages your database, Elastic
Load Balancing (ELB), Amazon ECS cluster, monitoring,
and logging
• Docker support
• Single container (on Amazon EC2)
• Multi container (on Amazon ECS)
42. Related Sessions
• CMP302 - Amazon EC2 Container Service: Distributed
Applications at Scale - Thursday, Oct 8, 2:45 PM
• DVO202 - DevOps at Amazon: A Look at Our Tools and
Processes - Wednesday, Oct 7, 12:15 PM
• DVO317 - From Local Docker Development to
Production Deployments - Wednesday, Oct 7, 4:15 PM