Shipping NodeJS with 
Docker and CoreOS 
@RossKukulinski 
BayNode Talk Night 
November 20, 2014
@RossKukulinski 
@RossKukulinski 
SpeakIt.io Founder 
BayNode Co-Organizer 
Soccer Fanatic 
Node-Forward Mentor
What I’m going to Cover 
@RossKukulinski 
• Our Story 
• Background on Docker & CoreOS 
• Tips & Tricks / Lessons Learned
The internal tool that wasn’t 
internal anymore 
@RossKukulinski
@RossKukulinski
@RossKukulinski 
12factor.net
@RossKukulinski 
Our Goals 
• Reduce application complexity (do one thing well!) 
• Scalable 
• Fault tolerant 
• Support running multiple versions of the same app 
• Consistent app from dev → test → staging → prod 
• Minimize time spent doing ‘devops’
@RossKukulinski 
Docker
VM vs Docker 
@RossKukulinski 
https://docker.com/whatisdocker/
@RossKukulinski 
• Containers start quickly 
• Containers have small footprint 
• Dockerized applications run anywhere 
• Really fast builds via cached images 
• Registry for storing images from build pipeline 
• Images can be layered 
• Abstracts app networking from system networking
@RossKukulinski 
Our Goals 
• Reduce application complexity (do one thing well!) 
• Scalable 
• Fault tolerant 
• Run multiple versions of the same app 
• Consistent app from dev → test → staging → prod 
• Minimize time spent doing ‘devops’
How do you ship 
docker containers? 
@RossKukulinski 
Bash scripts (ugh) 
Ansible / Puppet / Chef
Linux for Massive Server Deployments 
@RossKukulinski
@RossKukulinski 
• Minimal Operating System 
• Automated software updates 
• Runs docker containers 
• Supported by all major cloud 
providers 
• Can also run on bare metal 
https://coreos.com/
@RossKukulinski 
Fault Tolerant 
• Clustered by default 
• Support for multiple HA zones 
• Distributed tools like etcd & fleet 
• HTTP Key-Value Store 
• Service Discovery 
• Application Scheduling 
https://coreos.com/
@RossKukulinski 
Scalable 
https://coreos.com/
@RossKukulinski 
Goals 
• Reduce application complexity (do one thing well!) 
• Scalable 
• Fault tolerant 
• Run multiple versions of the same app 
• Consistent app from dev → test → staging → prod 
• Minimize time spent doing ‘devops’
Now for the good stuff 
@RossKukulinski 
Lessons Learned / Tips & Tricks
Docker Registry 
@RossKukulinski 
• Public Registry 
• Private Registry 
• Quay.io / DockerHub 
• Run your own 
• Take advantage of layering docker images
@RossKukulinski 
speakit/nodejs
Node App Dockerfile 
@RossKukulinski
Private GitHub Repos 
@RossKukulinski
> docker pull image:latest 
@RossKukulinski
Local CoreOS Dev 
• Can use Vagrant with a single (or multi) node 
cluster 
• Digital Ocean pretty cheap for small cluster 
@RossKukulinski
@RossKukulinski 
Monitoring 
• CLI tools (fleetctl via ssh) 
• CoreGI (github.com/astilabs/ 
CoreGI) 
• cAdvisor (github.com/google/ 
cadvisor)
Service Discovery 
@RossKukulinski 
• Don’t hardcode the 
host port of your 
container 
• Sidekick pattern -> Write 
to etcd 
• Confd (github.com/ 
kelseyhightower/confd) 
• Vulcan 
(vulcanproxy.com) 
https://coreos.com/
Cloud Load Balancers 
• How do your users access services in CoreOS? 
• Could run Global service with proxy on 80/443 
• Or update cloud lbs dynamically based on etcd 
• Soon: github.com/astilabs/CoreOS-Cloud-LB 
@RossKukulinski
npm install -g coreos-cluser-cli 
@RossKukulinski
Things to watch 
@RossKukulinski 
• Kubernetes 
• Google Container Engine 
• Vulcan Proxy 
• Paz (paz.sh) 
• Panamax (panamax.io) 
• Mesosphere (mesosphere.com)
@RossKukulinski 
Resources 
• Example cloud_config 
• https://gist.github.com/rosskukulinski/ 
9ddff8e5f67a24cc7bb7 
• Full example of sidekick pattern for Redis 
• https://gist.github.com/rosskukulinski/ 
96f7709fa20d7def6b9e 
• PXE Booting CoreOS Post coming soon…
Other Resources 
@RossKukulinski 
• CoreOS Docs: https://coreos.com/docs/ 
• CoreOS User Google Group 
• #coreos & #docker on FreeNode (I’m ‘rossk’) 
• SpeakIt GitHub (https://github.com/astilabs) 
• SpeakIt Blog (https://blog.speakit.io)
@RossKukulinski 
Thanks! 
Questions?

Shipping NodeJS with Docker and CoreOS (No Notes)

  • 1.
    Shipping NodeJS with Docker and CoreOS @RossKukulinski BayNode Talk Night November 20, 2014
  • 2.
    @RossKukulinski @RossKukulinski SpeakIt.ioFounder BayNode Co-Organizer Soccer Fanatic Node-Forward Mentor
  • 3.
    What I’m goingto Cover @RossKukulinski • Our Story • Background on Docker & CoreOS • Tips & Tricks / Lessons Learned
  • 5.
    The internal toolthat wasn’t internal anymore @RossKukulinski
  • 6.
  • 7.
  • 8.
    @RossKukulinski Our Goals • Reduce application complexity (do one thing well!) • Scalable • Fault tolerant • Support running multiple versions of the same app • Consistent app from dev → test → staging → prod • Minimize time spent doing ‘devops’
  • 9.
  • 10.
    VM vs Docker @RossKukulinski https://docker.com/whatisdocker/
  • 11.
    @RossKukulinski • Containersstart quickly • Containers have small footprint • Dockerized applications run anywhere • Really fast builds via cached images • Registry for storing images from build pipeline • Images can be layered • Abstracts app networking from system networking
  • 12.
    @RossKukulinski Our Goals • Reduce application complexity (do one thing well!) • Scalable • Fault tolerant • Run multiple versions of the same app • Consistent app from dev → test → staging → prod • Minimize time spent doing ‘devops’
  • 13.
    How do youship docker containers? @RossKukulinski Bash scripts (ugh) Ansible / Puppet / Chef
  • 14.
    Linux for MassiveServer Deployments @RossKukulinski
  • 15.
    @RossKukulinski • MinimalOperating System • Automated software updates • Runs docker containers • Supported by all major cloud providers • Can also run on bare metal https://coreos.com/
  • 16.
    @RossKukulinski Fault Tolerant • Clustered by default • Support for multiple HA zones • Distributed tools like etcd & fleet • HTTP Key-Value Store • Service Discovery • Application Scheduling https://coreos.com/
  • 17.
  • 18.
    @RossKukulinski Goals •Reduce application complexity (do one thing well!) • Scalable • Fault tolerant • Run multiple versions of the same app • Consistent app from dev → test → staging → prod • Minimize time spent doing ‘devops’
  • 19.
    Now for thegood stuff @RossKukulinski Lessons Learned / Tips & Tricks
  • 20.
    Docker Registry @RossKukulinski • Public Registry • Private Registry • Quay.io / DockerHub • Run your own • Take advantage of layering docker images
  • 21.
  • 22.
    Node App Dockerfile @RossKukulinski
  • 23.
    Private GitHub Repos @RossKukulinski
  • 24.
    > docker pullimage:latest @RossKukulinski
  • 25.
    Local CoreOS Dev • Can use Vagrant with a single (or multi) node cluster • Digital Ocean pretty cheap for small cluster @RossKukulinski
  • 26.
    @RossKukulinski Monitoring •CLI tools (fleetctl via ssh) • CoreGI (github.com/astilabs/ CoreGI) • cAdvisor (github.com/google/ cadvisor)
  • 27.
    Service Discovery @RossKukulinski • Don’t hardcode the host port of your container • Sidekick pattern -> Write to etcd • Confd (github.com/ kelseyhightower/confd) • Vulcan (vulcanproxy.com) https://coreos.com/
  • 28.
    Cloud Load Balancers • How do your users access services in CoreOS? • Could run Global service with proxy on 80/443 • Or update cloud lbs dynamically based on etcd • Soon: github.com/astilabs/CoreOS-Cloud-LB @RossKukulinski
  • 29.
    npm install -gcoreos-cluser-cli @RossKukulinski
  • 30.
    Things to watch @RossKukulinski • Kubernetes • Google Container Engine • Vulcan Proxy • Paz (paz.sh) • Panamax (panamax.io) • Mesosphere (mesosphere.com)
  • 31.
    @RossKukulinski Resources •Example cloud_config • https://gist.github.com/rosskukulinski/ 9ddff8e5f67a24cc7bb7 • Full example of sidekick pattern for Redis • https://gist.github.com/rosskukulinski/ 96f7709fa20d7def6b9e • PXE Booting CoreOS Post coming soon…
  • 32.
    Other Resources @RossKukulinski • CoreOS Docs: https://coreos.com/docs/ • CoreOS User Google Group • #coreos & #docker on FreeNode (I’m ‘rossk’) • SpeakIt GitHub (https://github.com/astilabs) • SpeakIt Blog (https://blog.speakit.io)
  • 33.