Docker, Cloud Foundry & Bosh. Why use containers? How does Bluemix fit into this? What about adding services? All these questions are answered, and more!
3. Today`s Meetup Sponsor:
IBM Bluemix - Public PaaS powered by Cloud Foundry
Register today at http://bluemix.net!
§ IBM initiative to develop a
Platform as a Services offering !
§ IBM and partner cloud
services!
§ Integrated DevOps with both
Browser and Eclipse-based
tools!
Run8mes
&
Frameworks
Services
Lifecycle
Management
(JazzHub)
Check
In
Code
Check
In
Code
Create
&
Manage
Services
Applica8on
Composi8on
Environment
Applica8on
Run8me
Web
IDE
(Eclipse
Orion)
Test/Run
Explore
Services
node
java
WebSphere
IBM
Bluemix ™
Eclipse
IDE
Test/Run
Explore
Services
ruby
Worklight
Liberty
Middleware
Applica8on
Opera8 Data
onal
Mobile
External
Meetup.com/Bluemix Meetup.com/CloudFoundry
4. Today`s Meetup Agenda:
Docker , Cloud Foundry and BOSH Meetup
Meetup.com/CloudFoundry Meetup.com/Bluemix !
September 10th, IBM North San Jose , Room # 1066 6:30 PM!
!
Sessions!
§ Docker Overview and Architecture Animesh Singh!
§ Docker Service Broker to manage Stateful Docker Containers Ferran Rodenas !
§ Cloud Foundry , Diego and Docker Michael Fraenkel!
§ Questions and Answers session!
!!!!
Meetup.com/Bluemix Meetup.com/CloudFoundry
5. Docker - What, Why and How!
Animesh Singh
@animeshsingh
Architecture and Deep Dive!
Source – http://docker.com!
Meetup.com/Bluemix Meetup.com/CloudFoundry
6. What is Docker
ü One of the most disruptive technologies of recent past!
ü Every significant vendor (IBM, Pivotal, OpenStack, Google, AWS, VMWare etc) has announced support for Docker!
ü First Docker conference was a huge success – with over 1000 attendees!
!
What is it ? !
A tool to!
§ Run applications: An open source tool to run applications inside of a Linux container, a kind of light-weight
virtual machine!
§ Package applications: In addition to running, it also offers tools to package containerized applications through
Docker files!
§ Distribute applications: Create your own Docker registries or hubs, a cloud service for sharing applications and
automating workflows.!
Meetup.com/Bluemix Meetup.com/CloudFoundry
8. It is a shipping container system for code
Static website
User DB
Web frontend
Queue
Analytics DB
Stacks
Mul8plicity
of
hardware
environments
An engine that enables any
payload to be encapsulated
as a lightweight, portable,
self-sufficient container…
Development VM
Customer Data
QA server
Public Cloud
…that can be manipulated using
standard operations and run
consistently on virtually any
hardware platform
Contributor’s
laptop
Mul8plicity
of
Production
Cluster
Center
Do
services
and
apps
interact
appropriately?
Can
I
migrate
smoothly
and
quickly
Meetup.com/Bluemix Meetup.com/CloudFoundry
9. Who can use Docker ?
ü Developers !
ü Sysadmins!
ü Operators!
!
For :!
§ Faster delivery of applications : Develop on local containers, share
development stack via Docker with colleagues, push code and the stack onto
a test environment !
!
§ Deploying and scaling more easily : Docker containers can be deployed
easily on a developer's local host, on physical or virtual machines in a data
center, or in the Cloud. It quickly scale up or tear down applications and
services in near real time.!
!
§ Achieving higher density and running more workloads: Docker is
lightweight and fast. It provides a viable alternative to hypervisor-based vms -
specially useful in high density environments: for example IaaS or PaaS!
Meetup.com/Bluemix Meetup.com/CloudFoundry
10. How does it work ?
Architectural Overview
§ Docker uses a client-server
architecture. !
!
§ The Docker client talks to the
Docker daemon, which does the
heavy lifting of building, running,
and distributing your Docker
containers. !
!
§ Both the Docker client and the
daemon can run on the same
system, or you can connect a
Docker client to a remote Docker
daemon. !
!
§ The Docker client and daemon
communicate via sockets or through
a RESTful API.!
Meetup.com/Bluemix Meetup.com/CloudFoundry
11. Docker Images, Dockerfile and Docker Registry https://registry.hub.docker.com/!
!
§ Docker images are read-only templates from which Docker
containers are launched. !
!
§ Each image consists of a series of layers. Docker makes use of
union file systems to combine these layers into a single image.
- reason Docker is so lightweight !
§ Every image starts from a base image, for example ubuntu, a
base Ubuntu image, or fedora, a base Fedora image. Docker
images are then built from these base images using a simple,
descriptive set of steps we call instructions. !
§ These instructions are stored in a file called a Dockerfile.
Docker reads this Dockerfile when you request a build of an
image, executes the instructions, and returns a final image.!
§ Docker images are hosted on Docker hub or registry!
!
Meetup.com/Bluemix Meetup.com/CloudFoundry
12. Docker Containers
!
ü A Docker container consists of an operating system, user-added
files, and meta-data – Basically a way to run mini operating
systems in your host operating system with strong guarantees of
isolation !
!
ü The Docker image is read-only. When Docker runs a container
from an image, it adds a read-write layer on top of the image
(using a union file system) in which your application can then run.!
!
ü Underlying Technology : Written in Go and makes use of several
Linux kernel features!
§ Namespaces - pid, net, mnt, ipc, etc.!
§ Control Groups - cgroups (memory, cpu, blkio, devices)!
§ Union File Systems - UnionFS (AUFS, btrfs, vfs)!
§ Container Format - libcontainer or LXC!
Meetup.com/Bluemix Meetup.com/CloudFoundry
14. Docker Containers vs Virtual Machines
Virtual Machines
Each virtualized application includes not only the
application - which may be only 10s of MB - and the
necessary binaries and libraries, but also an entire guest
operating system - which may weigh 10s of GB.
Docker
The Docker Engine container comprises just the
application and its dependencies. It runs as an isolated
process in userspace on the host operating system,
sharing the kernel with other containers
Compared with Hypervisors, Docker which is
OS-Level Virtualization:
• CPU Performance => native performance
• Memory Performance => few % for (optional)
accounting
• Network Performance => small overhead; can be
optimized to zero overhead
• creating a new base image takes a few seconds
(copy-on-write)
• apps in different containers can share the same
binaries / libs
Meetup.com/Bluemix Meetup.com/CloudFoundry
15. Cloud Foundry Architecture
CLI
Eclipse
IDE
Browser
cf
push
hSp
Cloud
Controller
(API)
(Message
bus)
Health
Manager
NATS
Router
DEA
Pool
DropletD
EExAe
Pcuo8ool
n
Agent
(DEA)
Pool
Meetup.com/Bluemix Meetup.com/CloudFoundry
16. Cloud Foundry Services
CLI
Eclipse
IDE
Browser
Cloud
Controller
(API)
S
E
R
V
I
C
E
B
R
O
K
E
R
Service
instance
Service
instance
Service
instance
DEA
Pool
Service
Backend
cf
create-‐
service
cf
bind-‐
service
Fetch Catalog
(GET /v2/catalog
Provision Instance
(PUT /v2/service
instances/:id)
Create Binding
(PUT /v2/
service_instances/:id
App
App
App
DEA
Pool
DEA
Pool
Meetup.com/Bluemix Meetup.com/CloudFoundry
17. Docker Service Broker for Cloud Foundry!
Ferran Rodenas @ferdy
Cloud Foundry Platform Engineering Team @ Pivotal
Meetup.com/Bluemix Meetup.com/CloudFoundry
18. Cloud Foundry Services!
Cloud Foundry Services enables application developers to
provision a service on demand and bind it to an application
using a really simple and agile workflow!
Meetup.com/Bluemix Meetup.com/CloudFoundry
20. Cloud Foundry Services!
• Where do I find services
ready for Cloud Foundry?!
• Do I need to create an
specific service broker?!
• Do I need to create a
BOSH release?!
Meetup.com/Bluemix Meetup.com/CloudFoundry
21. Docker Service Broker for Cloud Foundry!
An easy and convenient way to expose development and !
testing services to your applications without the overhead of !
creating an specific service broker by just using !
Docker images!
Disclaimer: !
!
Everything stated in this presentation is to be considered my wife’s opinion, I have none (in my opinion). !
Actual mileage may vary. !
Price does not include tax, title, and license. !
Some assembly required. !
Each sold separately. !
Batteries not included. !
Objects in mirror are closer than they appear. !
If conditions persist, contact a physician. !
Keep out of reach of children.!
Avoid prolonged exposure to direct sunlight.!
Keep in a cool dark place.!
Meetup.com/Bluemix Meetup.com/CloudFoundry
22. Docker Service Broker for Cloud Foundry!
• Services Catalog: predefined Docker services!
• Provision an instance: create and start a predefined Docker container and
assign random credentials via environment variables!
• Bind an instance to an application: send service credentials hash back to the
bound application!
• Unbind an instance!
• Unprovision an instance: destroy Docker container!
• Expose a management dashboard: top processes, stdout/stderr logs, …!
• Syslog drain URL: drain your application logs to a Docker syslog (logstash, …)!
Meetup.com/Bluemix Meetup.com/CloudFoundry
23. Docker Service Broker for Cloud Foundry!
It can be deployed as a standalone application, as a !
Docker container (frodenas/cf-containers-broker) OR!
!
Using the Docker BOSH Release:! https://github.com/cf-platform-eng/docker-boshrelease!
• Deploy it on your choice of IaaS!
• Service broker application self-healing!
• VM self-healing!
• Resize persistent data without data loss!
• Drain containers logs to a remote syslog!
Meetup.com/Bluemix Meetup.com/CloudFoundry
32. Cloud Foundry – Docker – Phase 1
Use Cases !
• As a user I want to push docker images from the public https://hub.docker.com (not
Dockerfile) "
• As a user I want to be able to start/stop and scale my docker image based
application "
• As a user I can see the health of my docker image based application "
• As an operator I want to be able to toggle docker image support "
Video – 1:05 – 4:30"
Meetup.com/Bluemix Meetup.com/CloudFoundry
33. Cloud Foundry – Docker – Current Limitations
Current Limitations !
"
• Only public docker repositories are supported"
• Docker images are cached on the executor node(s) (you will run out of disk space) "
• Docker applications must listen on port 8080 "
• As a user I must know the Docker image start command to push my the application
to CF "
• Restarting a staged Docker application may retrieve updates No direct CLI support
(later stage), you must use ‘cf curl"
• No direct CLI support (later stage), you must use ‘cf curl’ "
Meetup.com/Bluemix Meetup.com/CloudFoundry
35. References and Links
!
§ Diego Design Notes!
§ CF Summit Keynote (Slides)!
§ Cloud Foundry: Diego Explained!
§ App Placement in Cloud Foundry Diego!
§ Pivotal Tracker - Diego!
!!!!!
Meetup.com/Bluemix Meetup.com/CloudFoundry
36. Next Meetup:
Building Internet of Things(IoT) apps with IBM Bluemix (Powered by CloudFoundry)
IBM Bluemix Garage @ Galvanize in San Francisco!
http://www.meetup.com/Bluemix/events/206223082/!
http://www.meetup.com/CloudFoundry/events/206222562/!
!
Meetup.com/Bluemix Meetup.com/CloudFoundry