> Type <enter> to begin, use arrows or p/n to navigate.


 Hello

 - I'm mose, SysAdmin at Faria Systems

 - Devops duties
   = helping developers to (ab)use the infrastructure

 - 4 SaaS apps in production, 5 more apps in development
   all ruby on rails based applications,
   and hopefully some node.js and go for new apps



 Docker

 - https://www.docker.com

 - High level API for managing containers
   Written in Go

 - Created by DotCloud, a PaaS company
 
     march 2013 - First open source release
     june 2014  - First stable release



 Docker Containers

 - similar to BSD jail
 - run processes in isolation
 - protects the host OS
 - no supervisor
 - each container has an IP
 - created from an incremental image

   https://docker.com/whatisdocker


 Docker Ecosystem

 - Docker is very popular in coders community
   very active contributions in open source

 - official and community images
   https://registry.hub.docker.com/

 - a lot of solutions developed on the top of docker
   11 209 matches for 'docker' on github
   https://github.com/search?q=docker



 Docker for Self-Hosted PaaS

 - check full details on
   https://paas-tw.hackpad.com/aVcT24Fly7x

   Panamax ...... http://panamax.io
   Flynn ........ https://flynn.io
   Deis ......... http://deis.io
   Dokku ........ https://github.com/progrium/dokku
   Tsuru ........ http://www.tsuru.io
   Dawn ......... https://github.com/dawn/dawn
   Octohost ..... http://www.octohost.io



 Dokku = Docker + Heroku

 - Docker-powered mini-Heroku in around 100 lines of Bash

 - smart combination of
   - git (custom server, with deployment hook)
   - docker (building in containers)
   - buildstep (provisionning the stack)
   - sshcommand (user api for non-privileged operations)
   - pluginhook (for dokku plugins)
   - nginx (proxy for vhosts management)

 - easy one-line install on any linux host
 
 - various extensions for extending the dokku server
   https://github.com/progrium/dokku/wiki/Plugins



 Recorded live demo

 - not so live, it's a recording

First we need a server, let's create one ...

dokku tugboat
Commands:
 tugboat add-key NAME                                 # Upload an ssh public key.
 tugboat authorize                                    # Authorize a DigitalOcean account with tugboat
 tugboat create NAME                                  # Create a droplet.
 tugboat destroy FUZZY_NAME                           # Destroy a droplet
 tugboat destroy_image FUZZY_NAME                     # Destroy an image
 tugboat droplets                                     # Retrieve a list of your droplets
 tugboat halt FUZZY_NAME                              # Shutdown a droplet
 tugboat help [COMMAND]                               # Describe commands or a specific command
 tugboat images                                       # Retrieve a list of your images
 tugboat info FUZZY_NAME [OPTIONS]                    # Show a droplet's information
 tugboat info_image FUZZY_NAME [OPTIONS]              # Show an image's information
 tugboat keys                                         # Show available SSH keys
 tugboat password-reset FUZZY_NAME                    # Reset root password
 tugboat rebuild FUZZY_NAME IMAGE_NAME                # Rebuild a droplet.
 tugboat regions                                      # Show regions
 tugboat resize FUZZY_NAME -s, --size=N               # Resize a droplet
 tugboat restart FUZZY_NAME                           # Restart a droplet
 tugboat sizes                                        # Show available droplet sizes
 tugboat snapshot SNAPSHOT_NAME FUZZY_NAME [OPTIONS]  # Queue a snapshot of the droplet.
 tugboat ssh FUZZY_NAME                               # SSH into a droplet
 tugboat start FUZZY_NAME                             # Start a droplet
 tugboat verify                                       # Check your DigitalOcean credentials
 tugboat version                                      # Show version
 tugboat wait FUZZY_NAME                              # Wait for a droplet to reach a state

Options:
 -q, [--quiet]  

To learn more or to contribute, please see github.com/pearkes/tugboat
> elapsed: 0.1s

dokku tugboat images -g | grep -i ubuntu
bootstrapped base (id: 1907083, distro: Ubuntu)
kbsa-20130123 (id: 1983361, distro: Ubuntu)
isis-sandbox (id: 2274214, distro: Ubuntu)
eva-small-image (id: 4517074, distro: Ubuntu)
isis-multistage (id: 4520789, distro: Ubuntu)
po-dev-20140801 (id: 5381535, distro: Ubuntu)
20140805-oast (id: 5495107, distro: Ubuntu)
Ubuntu 14.04 x64 (id: 5141286, distro: Ubuntu)
Ubuntu 14.04 x32 (id: 5142677, distro: Ubuntu)
Ubuntu 10.04 x32 (id: 5566684, distro: Ubuntu)
Ubuntu 10.04 x64 (id: 5566812, distro: Ubuntu)
Ubuntu 12.04.5 x64 (id: 5588928, distro: Ubuntu)
Ubuntu 12.04.5 x32 (id: 5588929, distro: Ubuntu)
Ghost 0.4.2 on Ubuntu 12.04 (id: 3121555, distro: Ubuntu)
Ruby on Rails on Ubuntu 14.04 (Nginx + Unicorn) (id: 4261622, distro: Ubuntu)
node-v0.10.30 on Ubuntu 14.04 (id: 5505824, distro: Ubuntu)
Django on Ubuntu 14.04 (id: 5505940, distro: Ubuntu)
LAMP on Ubuntu 14.04 (id: 5506000, distro: Ubuntu)
LEMP on Ubuntu 14.04 (id: 5506010, distro: Ubuntu)
Docker 1.1.2 on Ubuntu 14.04 (id: 5506141, distro: Ubuntu)
MEAN on Ubuntu 14.04 (id: 5507160, distro: Ubuntu)
Dokku v0.2.3 on Ubuntu 14.04 (w/ Docker 1.1.2) (id: 5529453, distro: Ubuntu)
GitLab 7.1.1 CE (id: 5530248, distro: Ubuntu)
Redmine on Ubuntu 14.04 (id: 4869208, distro: Ubuntu)
WordPress on Ubuntu 14.04 (id: 4991187, distro: Ubuntu)
> elapsed: 4.5s

dokku tugboat create dokkudev -i 5588928
Queueing creation of droplet 'dokkudev'...done
> elapsed: 2.8s

dokku tugboat wait dokkudev
Droplet fuzzy name provided. Finding droplet ID...done, 2322346 (dokkudev)
Waiting for droplet to become active........done (23s)
> elapsed: 26.3s

dokku tugboat info dokkudev
Droplet fuzzy name provided. Finding droplet ID...done, 2322346 (dokkudev)

Name:             dokkudev
ID:               2322346
Status:           active
IP:               128.199.185.101
Region ID:        6
Image ID:         5588928
Size ID:          66
Backups Active:   false
> elapsed: 3.2s
Let's go install Dokku on the server, now ...

dokku tugboat ssh dokkudev -u root
Droplet fuzzy name provided. Finding droplet ID...done, 2322437 (dokkudev)
Executing SSH (dokkudev)...
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.13.0-32-generic x86_64)

* Documentation:  https://help.ubuntu.com/

 System information as of Wed Aug 13 03:53:37 EDT 2014

 System load:  0.0               Processes:           65
 Usage of /:   8.4% of 19.56GB   Users logged in:     0
 Memory usage: 11%               IP address for eth0: 128.199.185.101
 Swap usage:   0%

 Graph this data and manage this system at:
   https://landscape.canonical.com/


Your Hardware Enablement Stack (HWE) is supported until April 2017.

root@dokkudev:~$
root@dokkudev:~$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
Hit http://mirrors.digitalocean.com precise Release.gpg
Get:1 http://mirrors.digitalocean.com precise-updates Release.gpg [198 B]
Hit http://mirrors.digitalocean.com precise-backports Release.gpg
Get:2 http://mirrors.digitalocean.com precise-security Release.gpg [198 B]
Hit http://ppa.launchpad.net precise Release.gpg
Hit http://ppa.launchpad.net precise Release
Hit http://mirrors.digitalocean.com precise Release
Get:3 http://mirrors.digitalocean.com precise-updates Release [98.7 kB]
Hit http://mirrors.digitalocean.com precise-backports Release
Hit http://ppa.launchpad.net precise/main Sources
Hit http://ppa.launchpad.net precise/main amd64 Packages
Hit http://ppa.launchpad.net precise/main i386 Packages
Ign http://ppa.launchpad.net precise/main TranslationIndex
Get:4 http://mirrors.digitalocean.com precise-security Release [50.7 kB]
Hit http://mirrors.digitalocean.com precise/main Sources
Hit http://mirrors.digitalocean.com precise/restricted Sources
Hit http://mirrors.digitalocean.com precise/universe Sources
Hit http://mirrors.digitalocean.com precise/multiverse Sources
Hit http://mirrors.digitalocean.com precise/main amd64 Packages
Hit http://mirrors.digitalocean.com precise/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise/main i386 Packages
Hit http://mirrors.digitalocean.com precise/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise/universe i386 Packages
Hit http://mirrors.digitalocean.com precise/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise/main TranslationIndex
Hit http://mirrors.digitalocean.com precise/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise/universe TranslationIndex
Get:5 http://mirrors.digitalocean.com precise-updates/main Sources [477 kB]
Get:6 http://mirrors.digitalocean.com precise-updates/restricted Sources [8,056 B]
Get:7 http://mirrors.digitalocean.com precise-updates/universe Sources [110 kB]
Get:8 http://mirrors.digitalocean.com precise-updates/multiverse Sources [8,881 B]
Get:9 http://mirrors.digitalocean.com precise-updates/main amd64 Packages [824 kB]
Get:10 http://mirrors.digitalocean.com precise-updates/restricted amd64 Packages [13.7 kB]
Get:11 http://mirrors.digitalocean.com precise-updates/universe amd64 Packages [247 kB]
Get:12 http://mirrors.digitalocean.com precise-updates/multiverse amd64 Packages [15.3 kB]
Get:13 http://mirrors.digitalocean.com precise-updates/main i386 Packages [855 kB]
Get:14 http://mirrors.digitalocean.com precise-updates/restricted i386 Packages [13.7 kB]
Get:15 http://mirrors.digitalocean.com precise-updates/universe i386 Packages [253 kB]
Get:16 http://mirrors.digitalocean.com precise-updates/multiverse i386 Packages [15.5 kB]
Hit http://mirrors.digitalocean.com precise-updates/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/multiverse TranslationIndex
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Hit http://mirrors.digitalocean.com precise-updates/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/main Sources
Hit http://mirrors.digitalocean.com precise-backports/restricted Sources
Hit http://mirrors.digitalocean.com precise-backports/universe Sources
Hit http://mirrors.digitalocean.com precise-backports/multiverse Sources
Hit http://mirrors.digitalocean.com precise-backports/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/main i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/universe TranslationIndex
Get:17 http://mirrors.digitalocean.com precise-security/main Sources [108 kB]
Get:18 http://mirrors.digitalocean.com precise-security/restricted Sources [2,494 B]
Get:19 http://mirrors.digitalocean.com precise-security/universe Sources [32.7 kB]
Get:20 http://mirrors.digitalocean.com precise-security/multiverse Sources [1,786 B]
Get:21 http://mirrors.digitalocean.com precise-security/main amd64 Packages [415 kB]
Get:22 http://mirrors.digitalocean.com precise-security/restricted amd64 Packages [4,627 B]
Get:23 http://mirrors.digitalocean.com precise-security/universe amd64 Packages [96.8 kB]
Get:24 http://mirrors.digitalocean.com precise-security/multiverse amd64 Packages [2,451 B]
Get:25 http://mirrors.digitalocean.com precise-security/main i386 Packages [443 kB]
Get:26 http://mirrors.digitalocean.com precise-security/restricted i386 Packages [4,620 B]
Get:27 http://mirrors.digitalocean.com precise-security/universe i386 Packages [102 kB]
Get:28 http://mirrors.digitalocean.com precise-security/multiverse i386 Packages [2,644 B]
Hit http://mirrors.digitalocean.com precise-security/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise/main Translation-en
Hit http://mirrors.digitalocean.com precise/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise/restricted Translation-en
Hit http://mirrors.digitalocean.com precise/universe Translation-en
Hit http://mirrors.digitalocean.com precise-updates/main Translation-en
Hit http://mirrors.digitalocean.com precise-updates/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-updates/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-updates/universe Translation-en
Hit http://mirrors.digitalocean.com precise-backports/main Translation-en
Hit http://mirrors.digitalocean.com precise-backports/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-backports/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-backports/universe Translation-en
Hit http://mirrors.digitalocean.com precise-security/main Translation-en
Hit http://mirrors.digitalocean.com precise-security/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-security/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-security/universe Translation-en
Fetched 4,206 kB in 7s (560 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version.
make is already the newest version.
make set to manually installed.
Suggested packages:
 git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb
The following NEW packages will be installed:
 git git-man liberror-perl software-properties-common
0 upgraded, 4 newly installed, 0 to remove and 9 not upgraded.
Need to get 6,749 kB of archives.
After this operation, 15.4 MB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu/ precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu/ precise/main git-man all 1:1.7.9.5-1 [630 kB]
Get:3 http://mirrors.digitalocean.com/ubuntu/ precise/main git amd64 1:1.7.9.5-1 [6,087 kB]
Get:4 http://mirrors.digitalocean.com/ubuntu/ precise-updates/main software-properties-common all 0.82.7.7 [8,450 B]
Fetched 6,749 kB in 0s (7,772 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 116282 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.9.5-1_all.deb) ...
Selecting previously unselected package git.
Unpacking git (from .../git_1%3a1.7.9.5-1_amd64.deb) ...
Selecting previously unselected package software-properties-common.
Unpacking software-properties-common (from .../software-properties-common_0.82.7.7_all.deb) ...
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.9.5-1) ...
Setting up git (1:1.7.9.5-1) ...
Setting up software-properties-common (0.82.7.7) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-software-properties is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Cloning into 'dokku'...
remote: Counting objects: 2020, done.
remote: Total 2020 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2020/2020), 377.81 KiB | 123 KiB/s, done.
Resolving deltas: 100% (898/898), done.
wget -qO /usr/local/bin/sshcommand https://raw.github.com/progrium/sshcommand/master/sshcommand
chmod +x /usr/local/bin/sshcommand
sshcommand create dokku /usr/local/bin/dokku
wget -qO /tmp/pluginhook_0.1.0_amd64.deb https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb
Selecting previously unselected package pluginhook.
(Reading database ... 116945 files and directories currently installed.)
Unpacking pluginhook (from .../tmp/pluginhook_0.1.0_amd64.deb) ...
Setting up pluginhook (0.1.0) ...
lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
curl https://get.docker.io/gpg | apt-key add -
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
100   975  100   975    0     0    615      0  0:00:01  0:00:01 --:--:--   892
OK
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update
Hit http://mirrors.digitalocean.com precise Release.gpg
Hit http://mirrors.digitalocean.com precise-updates Release.gpg
Hit http://mirrors.digitalocean.com precise-backports Release.gpg
Hit http://mirrors.digitalocean.com precise-security Release.gpg
Hit http://mirrors.digitalocean.com precise Release
Hit http://mirrors.digitalocean.com precise-updates Release
Hit http://mirrors.digitalocean.com precise-backports Release
Hit http://mirrors.digitalocean.com precise-security Release
Hit http://mirrors.digitalocean.com precise/main Sources
Hit http://mirrors.digitalocean.com precise/restricted Sources
Hit http://mirrors.digitalocean.com precise/universe Sources
Hit http://mirrors.digitalocean.com precise/multiverse Sources
Hit http://mirrors.digitalocean.com precise/main amd64 Packages
Hit http://mirrors.digitalocean.com precise/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise/main i386 Packages
Hit http://mirrors.digitalocean.com precise/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise/universe i386 Packages
Hit http://mirrors.digitalocean.com precise/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise/main TranslationIndex
Hit http://mirrors.digitalocean.com precise/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise/main Translation-en
Hit http://mirrors.digitalocean.com precise/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise/restricted Translation-en
Hit http://mirrors.digitalocean.com precise/universe Translation-en
Hit http://mirrors.digitalocean.com precise-updates/main Sources
Hit http://mirrors.digitalocean.com precise-updates/restricted Sources
Hit http://mirrors.digitalocean.com precise-updates/universe Sources
Hit http://mirrors.digitalocean.com precise-updates/multiverse Sources
Hit http://mirrors.digitalocean.com precise-updates/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/main i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/main Translation-en
Hit http://mirrors.digitalocean.com precise-updates/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-updates/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-updates/universe Translation-en
Hit http://mirrors.digitalocean.com precise-backports/main Sources
Hit http://mirrors.digitalocean.com precise-backports/restricted Sources
Hit http://mirrors.digitalocean.com precise-backports/universe Sources
Hit http://mirrors.digitalocean.com precise-backports/multiverse Sources
Hit http://mirrors.digitalocean.com precise-backports/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/main i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/main Sources
Hit http://mirrors.digitalocean.com precise-security/restricted Sources
Hit http://mirrors.digitalocean.com precise-security/universe Sources
Hit http://mirrors.digitalocean.com precise-security/multiverse Sources
Hit http://mirrors.digitalocean.com precise-security/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/main i386 Packages
Hit http://mirrors.digitalocean.com precise-security/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-security/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-security/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-security/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/main Translation-en
Hit http://mirrors.digitalocean.com precise-backports/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-backports/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-backports/universe Translation-en
Hit http://mirrors.digitalocean.com precise-security/main Translation-en
Hit http://mirrors.digitalocean.com precise-security/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-security/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-security/universe Translation-en
Hit http://ppa.launchpad.net precise Release.gpg
Get:1 http://get.docker.io docker Release.gpg [473 B]
Hit http://ppa.launchpad.net precise Release
Get:2 http://get.docker.io docker Release [1,525 B]
Hit http://ppa.launchpad.net precise/main Sources
Hit http://ppa.launchpad.net precise/main amd64 Packages
Hit http://ppa.launchpad.net precise/main i386 Packages
Ign http://ppa.launchpad.net precise/main TranslationIndex
Get:3 http://get.docker.io docker/main amd64 Packages [4,532 B]
Get:4 http://get.docker.io docker/main i386 Packages [20 B]
Ign http://get.docker.io docker/main TranslationIndex
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Ign http://get.docker.io docker/main Translation-en_US
Ign http://get.docker.io docker/main Translation-en
Fetched 6,550 B in 6s (992 B/s)
Reading package lists... Done
apt-get install -y lxc-docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
 aufs-tools cgroup-lite lxc-docker-1.1.2
The following NEW packages will be installed:
 aufs-tools cgroup-lite lxc-docker lxc-docker-1.1.2
0 upgraded, 4 newly installed, 0 to remove and 9 not upgraded.
Need to get 4,531 kB of archives.
After this operation, 18.1 MB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu/ precise/universe aufs-tools amd64 1:3.0+20111101-1ubuntu1 [98.8 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu/ precise-updates/main cgroup-lite all 1.1.5 [4,098 B]
Get:3 http://get.docker.io/ubuntu/ docker/main lxc-docker-1.1.2 amd64 1.1.2 [4,426 kB]
Get:4 http://get.docker.io/ubuntu/ docker/main lxc-docker amd64 1.1.2 [1,786 B]
Fetched 4,531 kB in 9s (502 kB/s)
Selecting previously unselected package aufs-tools.
(Reading database ... 116948 files and directories currently installed.)
Unpacking aufs-tools (from .../aufs-tools_1%3a3.0+20111101-1ubuntu1_amd64.deb) ...
Selecting previously unselected package cgroup-lite.
Unpacking cgroup-lite (from .../cgroup-lite_1.1.5_all.deb) ...
Selecting previously unselected package lxc-docker-1.1.2.
Unpacking lxc-docker-1.1.2 (from .../lxc-docker-1.1.2_1.1.2_amd64.deb) ...
Selecting previously unselected package lxc-docker.
Unpacking lxc-docker (from .../lxc-docker_1.1.2_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up aufs-tools (1:3.0+20111101-1ubuntu1) ...
Setting up cgroup-lite (1.1.5) ...
cgroup-lite start/running
Setting up lxc-docker-1.1.2 (1.1.2) ...
docker start/running, process 3999
Setting up lxc-docker (1.1.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
sleep 2 # give docker a moment i guess
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
100   355    0   355    0     0    305      0 --:--:--  0:00:01 --:--:--   467
100  330M  100  330M    0     0   842k      0  0:06:41  0:06:41 --:--:--  936k
b565fe10d5643dd69de1968549d9918214809790ea88c1e907a1513fdd8044c2
mkdir -p /usr/local/share/man/man1
cp dokku.1 /usr/local/share/man/man1/dokku.1
mandb
Purging old database entries in /usr/share/man...
Processing manual pages under /usr/share/man...
Purging old database entries in /usr/share/man/it...
Processing manual pages under /usr/share/man/it...
Purging old database entries in /usr/share/man/fi...
Processing manual pages under /usr/share/man/fi...
Purging old database entries in /usr/share/man/ja...
Processing manual pages under /usr/share/man/ja...
Purging old database entries in /usr/share/man/gl...
Processing manual pages under /usr/share/man/gl...
Purging old database entries in /usr/share/man/nl...
Processing manual pages under /usr/share/man/nl...
Purging old database entries in /usr/share/man/de...
Processing manual pages under /usr/share/man/de...
Purging old database entries in /usr/share/man/pl...
Processing manual pages under /usr/share/man/pl...
Purging old database entries in /usr/share/man/zh_TW...
Processing manual pages under /usr/share/man/zh_TW...
Purging old database entries in /usr/share/man/pt...
Processing manual pages under /usr/share/man/pt...
Purging old database entries in /usr/share/man/ko...
Processing manual pages under /usr/share/man/ko...
Purging old database entries in /usr/share/man/sl...
Processing manual pages under /usr/share/man/sl...
Purging old database entries in /usr/share/man/fr.ISO8859-1...
Processing manual pages under /usr/share/man/fr.ISO8859-1...
Purging old database entries in /usr/share/man/fr...
Processing manual pages under /usr/share/man/fr...
Purging old database entries in /usr/share/man/es...
Processing manual pages under /usr/share/man/es...
Purging old database entries in /usr/share/man/id...
Processing manual pages under /usr/share/man/id...
Purging old database entries in /usr/share/man/fr.UTF-8...
Processing manual pages under /usr/share/man/fr.UTF-8...
Purging old database entries in /usr/share/man/tr...
Processing manual pages under /usr/share/man/tr...
Purging old database entries in /usr/share/man/cs...
Processing manual pages under /usr/share/man/cs...
Purging old database entries in /usr/share/man/ru...
Processing manual pages under /usr/share/man/ru...
Purging old database entries in /usr/share/man/zh_CN...
Processing manual pages under /usr/share/man/zh_CN...
Purging old database entries in /usr/share/man/hu...
Processing manual pages under /usr/share/man/hu...
Purging old database entries in /usr/share/man/sv...
Processing manual pages under /usr/share/man/sv...
Purging old database entries in /usr/share/man/pt_BR...
Processing manual pages under /usr/share/man/pt_BR...
Processing manual pages under /usr/local/share/man...
Updating index cache for path `/usr/local/share/man/man1'. Wait...done.
Checking for stray cats under /usr/local/share/man...
Checking for stray cats under /var/cache/man/local...
1 man subdirectory contained newer manual pages.
1 manual page was added.
0 stray cats were added.
24 old database entries were purged.
cp dokku /usr/local/bin/dokku
mkdir -p /var/lib/dokku/plugins
cp -r plugins/* /var/lib/dokku/plugins
dokku plugins-install
gpg: keyring `/tmp/tmpsRYNLG/secring.gpg' created
gpg: keyring `/tmp/tmpsRYNLG/pubring.gpg' created
gpg: requesting key C300EE8C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpsRYNLG/trustdb.gpg: trustdb created
gpg: key C300EE8C: public key "Launchpad Stable" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
Hit http://ppa.launchpad.net precise Release.gpg
Get:1 http://ppa.launchpad.net precise Release.gpg [316 B]
Hit http://mirrors.digitalocean.com precise Release.gpg
Hit http://mirrors.digitalocean.com precise-updates Release.gpg
Hit http://mirrors.digitalocean.com precise-backports Release.gpg
Hit http://mirrors.digitalocean.com precise-security Release.gpg
Hit http://ppa.launchpad.net precise Release
Hit http://get.docker.io docker Release.gpg
Get:2 http://ppa.launchpad.net precise Release [11.9 kB]
Hit http://ppa.launchpad.net precise/main Sources
Hit http://ppa.launchpad.net precise/main amd64 Packages
Hit http://ppa.launchpad.net precise/main i386 Packages
Ign http://ppa.launchpad.net precise/main TranslationIndex
Hit http://get.docker.io docker Release
Hit http://mirrors.digitalocean.com precise Release
Hit http://mirrors.digitalocean.com precise-updates Release
Hit http://mirrors.digitalocean.com precise-backports Release
Get:3 http://ppa.launchpad.net precise/main Sources [1,577 B]
Get:4 http://ppa.launchpad.net precise/main amd64 Packages [5,639 B]
Get:5 http://ppa.launchpad.net precise/main i386 Packages [5,640 B]
Hit http://mirrors.digitalocean.com precise-security Release
Hit http://mirrors.digitalocean.com precise/main Sources
Hit http://mirrors.digitalocean.com precise/restricted Sources
Hit http://mirrors.digitalocean.com precise/universe Sources
Hit http://mirrors.digitalocean.com precise/multiverse Sources
Hit http://mirrors.digitalocean.com precise/main amd64 Packages
Hit http://mirrors.digitalocean.com precise/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise/main i386 Packages
Hit http://mirrors.digitalocean.com precise/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise/universe i386 Packages
Hit http://mirrors.digitalocean.com precise/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise/main TranslationIndex
Hit http://mirrors.digitalocean.com precise/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/main Sources
Hit http://mirrors.digitalocean.com precise-updates/restricted Sources
Hit http://mirrors.digitalocean.com precise-updates/universe Sources
Hit http://mirrors.digitalocean.com precise-updates/multiverse Sources
Hit http://mirrors.digitalocean.com precise-updates/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-updates/main i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-updates/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-updates/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/main Sources
Hit http://mirrors.digitalocean.com precise-backports/restricted Sources
Hit http://mirrors.digitalocean.com precise-backports/universe Sources
Hit http://mirrors.digitalocean.com precise-backports/multiverse Sources
Hit http://mirrors.digitalocean.com precise-backports/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-backports/main i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-backports/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/restricted TranslationIndex
Hit http://mirrors.digitalocean.com precise-backports/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise/main Translation-en
Hit http://mirrors.digitalocean.com precise/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise/restricted Translation-en
Hit http://mirrors.digitalocean.com precise/universe Translation-en
Hit http://mirrors.digitalocean.com precise-updates/main Translation-en
Hit http://mirrors.digitalocean.com precise-updates/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-updates/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-updates/universe Translation-en
Hit http://mirrors.digitalocean.com precise-backports/main Translation-en
Hit http://mirrors.digitalocean.com precise-backports/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-backports/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-backports/universe Translation-en
Hit http://mirrors.digitalocean.com precise-security/main Sources
Hit http://mirrors.digitalocean.com precise-security/restricted Sources
Hit http://mirrors.digitalocean.com precise-security/universe Sources
Hit http://mirrors.digitalocean.com precise-security/multiverse Sources
Hit http://mirrors.digitalocean.com precise-security/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/restricted amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/universe amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/multiverse amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/main i386 Packages
Hit http://mirrors.digitalocean.com precise-security/restricted i386 Packages
Hit http://mirrors.digitalocean.com precise-security/universe i386 Packages
Hit http://mirrors.digitalocean.com precise-security/multiverse i386 Packages
Hit http://mirrors.digitalocean.com precise-security/main TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/multiverse TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/restricted TranslationIndex
Hit http://get.docker.io docker/main amd64 Packages
Hit http://mirrors.digitalocean.com precise-security/universe TranslationIndex
Hit http://mirrors.digitalocean.com precise-security/main Translation-en
Hit http://mirrors.digitalocean.com precise-security/multiverse Translation-en
Hit http://mirrors.digitalocean.com precise-security/restricted Translation-en
Hit http://mirrors.digitalocean.com precise-security/universe Translation-en
Ign http://ppa.launchpad.net precise/main TranslationIndex
Hit http://get.docker.io docker/main i386 Packages
Ign http://get.docker.io docker/main TranslationIndex
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Ign http://get.docker.io docker/main Translation-en_US
Ign http://get.docker.io docker/main Translation-en
Fetched 25.0 kB in 5s (4,301 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
dnsutils is already the newest version.
The following extra packages will be installed:
 libev4 libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx-common nginx-full passenger-common passenger-common1.8 ruby-rack
Suggested packages:
 libgd-tools rails passenger-doc
The following NEW packages will be installed:
 libev4 libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx nginx-common nginx-full passenger-common passenger-common1.8 ruby-rack
0 upgraded, 11 newly installed, 0 to remove and 9 not upgraded.
Need to get 3,094 kB of archives.
After this operation, 10.0 MB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu/ precise-updates/main libjpeg-turbo8 amd64 1.1.90+svn733-0ubuntu4.4 [112 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu/ precise-updates/main libxslt1.1 amd64 1.1.26-8ubuntu1.3 [167 kB]
Get:3 http://mirrors.digitalocean.com/ubuntu/ precise/main libjpeg8 amd64 8c-2ubuntu7 [2,112 B]
Get:4 http://mirrors.digitalocean.com/ubuntu/ precise/main libgd2-noxpm amd64 2.0.36~rc1~dfsg-6ubuntu2 [200 kB]
Get:5 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ precise/main nginx-common all 1:1.2.9-1bbox1+ng~precise1 [76.2 kB]
Get:6 http://mirrors.digitalocean.com/ubuntu/ precise/universe libev4 amd64 1:4.11-1 [29.0 kB]
Get:7 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ precise/main ruby-rack all 1.3.10-0~11~precise1 [76.3 kB]
Get:8 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ precise/main passenger-common1.8 amd64 1:3.0.21-1bbox1+ng [135 kB]
Get:9 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ precise/main passenger-common amd64 1:3.0.21-1bbox1+ng [1,622 kB]
Get:10 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ precise/main nginx-full amd64 1:1.2.9-1bbox1+ng~precise1 [611 kB]
Get:11 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ precise/main nginx all 1:1.2.9-1bbox1+ng~precise1 [64.2 kB]
Fetched 3,094 kB in 5s (560 kB/s)
Selecting previously unselected package libjpeg-turbo8.
(Reading database ... 117060 files and directories currently installed.)
Unpacking libjpeg-turbo8 (from .../libjpeg-turbo8_1.1.90+svn733-0ubuntu4.4_amd64.deb) ...
Selecting previously unselected package libxslt1.1.
Unpacking libxslt1.1 (from .../libxslt1.1_1.1.26-8ubuntu1.3_amd64.deb) ...
Selecting previously unselected package libjpeg8.
Unpacking libjpeg8 (from .../libjpeg8_8c-2ubuntu7_amd64.deb) ...
Selecting previously unselected package libgd2-noxpm.
Unpacking libgd2-noxpm (from .../libgd2-noxpm_2.0.36~rc1~dfsg-6ubuntu2_amd64.deb) ...
Selecting previously unselected package nginx-common.
Unpacking nginx-common (from .../nginx-common_1%3a1.2.9-1bbox1+ng~precise1_all.deb) ...
Selecting previously unselected package libev4.
Unpacking libev4 (from .../libev4_1%3a4.11-1_amd64.deb) ...
Selecting previously unselected package ruby-rack.
Unpacking ruby-rack (from .../ruby-rack_1.3.10-0~11~precise1_all.deb) ...
Selecting previously unselected package passenger-common1.8.
Unpacking passenger-common1.8 (from .../passenger-common1.8_1%3a3.0.21-1bbox1+ng_amd64.deb) ...
Selecting previously unselected package passenger-common.
Unpacking passenger-common (from .../passenger-common_1%3a3.0.21-1bbox1+ng_amd64.deb) ...
Selecting previously unselected package nginx-full.
Unpacking nginx-full (from .../nginx-full_1%3a1.2.9-1bbox1+ng~precise1_amd64.deb) ...
Selecting previously unselected package nginx.
Unpacking nginx (from .../nginx_1%3a1.2.9-1bbox1+ng~precise1_all.deb) ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Processing triggers for man-db ...
Setting up libjpeg-turbo8 (1.1.90+svn733-0ubuntu4.4) ...
Setting up libxslt1.1 (1.1.26-8ubuntu1.3) ...
Setting up libjpeg8 (8c-2ubuntu7) ...
Setting up libgd2-noxpm (2.0.36~rc1~dfsg-6ubuntu2) ...
Setting up nginx-common (1:1.2.9-1bbox1+ng~precise1) ...
Setting up libev4 (1:4.11-1) ...
Setting up ruby-rack (1.3.10-0~11~precise1) ...
Setting up passenger-common1.8 (1:3.0.21-1bbox1+ng) ...
Setting up passenger-common (1:3.0.21-1bbox1+ng) ...
Setting up nginx-full (1:1.2.9-1bbox1+ng~precise1) ...
Setting up nginx (1:1.2.9-1bbox1+ng~precise1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
* Starting nginx nginx                                                                                                                                        [ OK ]
git describe --tags > /home/dokku/VERSION  2> /dev/null || echo '~master (2014-08-13T16:07+0000)' > /home/dokku/VERSION

Almost done! For next steps on configuration:
 https://github.com/progrium/dokku#configuring

> elapsed: 498.0s
root@dokkudev:~$ echo "dokku.mose.com" > /home/dokku/VHOST

> elapsed: 0.0s
root@dokkudev:~$ exit
logout
Connection to 128.199.185.101 closed.
>

dokku cat ~/.ssh/id_rsa.pub | ssh root@dokku.mose.com "sshcommand acl-add dokku deploy"
87:d4:b6:76:f8:1f:40:07:d7:80:54:44:fd:68:61:9f
> elapsed: 2.7s

dokku echo "address=/dokku.mose.com/128.199.185.101" >> /usr/local/etc/dnsmasq.conf

dokku sudo launchctl stop homebrew.mxcl.dnsmasq

dokku sudo launchctl start homebrew.mxcl.dnsmasq

dokku sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dokku.mose.com'

dokku sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

dokku sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

dokku ping -c 1 dokku.mose.com
PING dokku.mose.com (128.199.185.101): 56 data bytes
64 bytes from 128.199.185.101: icmp_seq=0 ttl=54 time=72.578 ms

--- dokku.mose.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 72.578/72.578/72.578/0.000 ms
> elapsed: 0.1s

dokku ping -c 1 whatever.dokku.mose.com
PING whatever.dokku.mose.com (128.199.185.101): 56 data bytes
64 bytes from 128.199.185.101: icmp_seq=0 ttl=54 time=74.379 ms

--- whatever.dokku.mose.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 74.379/74.379/74.379/0.000 ms
> elapsed: 0.1s
Now let's install a sample node app and deploy it ...

dokku hub clone heroku/node-js-sample
Cloning into 'node-js-sample'...
> elapsed: 3.2s

dokku cd node-js-sample

> elapsed: 0.0s

node-js-sample ls -l
total 32
-rw-r--r--  1 mose  staff  1254 Aug 13 19:08 README.md
-rw-r--r--  1 mose  staff   254 Aug 13 19:08 app.json
-rw-r--r--  1 mose  staff   339 Aug 13 19:08 index.js
drwxr-xr-x  3 mose  staff   102 Aug 13 19:09 node_modules
-rw-r--r--  1 mose  staff   575 Aug 13 19:08 package.json
drwxr-xr-x  3 mose  staff   102 Aug 13 19:08 public
> elapsed: 0.0s

node-js-sample pygmentize index.js
var express = require('express')
var app = express();

app
.set('port', (process.env.PORT || 5000))
app
.use(express.static(__dirname + '/public'))

app
.get('/', function(request, response) {
 
response.send('Hello World!')
}
)

app
.listen(app.get('port'), function() {
 
console.log("Node app is running at localhost:" + app.get('port'))
}
)
> elapsed: 0.1s

node-js-sample git remote add deploy dokku@dokku.mose.com:node-js-app

>

node-js-sample git push deploy master
Counting objects: 378, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (304/304), done.
Writing objects: 100% (378/378), 209.77 KiB | 0 bytes/s, done.
Total 378 (delta 45), reused 378 (delta 45)
-----> Cleaning up ...
-----> Building node-js-app ...
remote: warning: You appear to have cloned an empty repository.
remote: HEAD is now at 97a7c5c... wording
      Node.js app detected
-----> Requested node range:  0.10.x
-----> Resolved node version: 0.10.30
-----> Downloading and installing node
-----> Writing a custom .npmrc to circumvent npm bugs
-----> Installing dependencies
      express@4.8.3 node_modules/express
      ├── merge-descriptors@0.0.2
      ├── utils-merge@1.0.0
      ├── cookie@0.1.2
      ├── escape-html@1.0.1
      ├── cookie-signature@1.0.4
      ├── finalhandler@0.1.0
      ├── range-parser@1.0.0
      ├── fresh@0.2.2
      ├── vary@0.1.0
      ├── media-typer@0.2.0
      ├── methods@1.1.0
      ├── parseurl@1.3.0
      ├── serve-static@1.5.1
      ├── buffer-crc32@0.2.3
      ├── depd@0.4.4
      ├── path-to-regexp@0.1.3
      ├── qs@1.2.1
      ├── type-is@1.3.2 (mime-types@1.0.2)
      ├── accepts@1.0.7 (negotiator@0.4.7, mime-types@1.0.2)
      ├── proxy-addr@1.0.1 (ipaddr.js@0.1.2)
      ├── debug@1.0.4 (ms@0.6.2)
      └── send@0.8.1 (mime@1.2.11, ms@0.6.2, finished@1.2.2)
-----> Caching node_modules directory for future builds
-----> Cleaning up node-gyp and npm artifacts
-----> No Procfile found; Adding npm start to new Procfile
-----> Building runtime environment
-----> Discovering process types
      Procfile declares types -> web
-----> Releasing node-js-app ...
-----> Deploying node-js-app ...
=====> Application deployed:
      http://node-js-app.dokku.mose.com

To dokku@dokku.mose.com:node-js-app
* [new branch]      master -> master

> elapsed: 19.2s
Let's go to the server see what happened ...

dokku tugboat ssh dokkudev -u root
Droplet fuzzy name provided. Finding droplet ID...done, 2322437 (dokkudev)
Executing SSH (dokkudev)...
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.13.0-32-generic x86_64)

* Documentation:  https://help.ubuntu.com/

 System information as of Wed Aug 13 03:53:37 EDT 2014

 System load:  0.0               Processes:           65
 Usage of /:   8.4% of 19.56GB   Users logged in:     0
 Memory usage: 11%               IP address for eth0: 128.199.185.101
 Swap usage:   0%

 Graph this data and manage this system at:
   https://landscape.canonical.com/


Your Hardware Enablement Stack (HWE) is supported until April 2017.

root@dokkudev:~$
root@dokkudev:~$ cd /home/dokku

> elapsed: 0.0s
root@dokkudev:/home/dokku$ ll
total 36
drwxr-xr-x 5 dokku root  4096 Aug 13 12:28 ./
drwxr-xr-x 3 root  root  4096 Aug 13 12:00 ../
drwx------ 2 dokku dokku 4096 Aug 13 12:28 .cache/
-rw-r--r-- 1 root  root     9 Aug 13 12:07 HOSTNAME
drwxrwxr-x 8 dokku dokku 4096 Aug 13 12:34 node-js-app/
drwxr-xr-x 2 dokku root  4096 Aug 13 12:00 .ssh/
-rw-r--r-- 1 dokku root    21 Aug 13 12:00 .sshcommand
-rw-r--r-- 1 root  root    18 Aug 13 12:07 VERSION
-rw-r--r-- 1 root  root    15 Aug 13 12:16 VHOST
>
root@dokkudev:/home/dokku$ cat .ssh/authorized_keys
command="FINGERPRINT=87:d4:b6:76:f8:1f:40:07:d7:80:54:44:fd:68:61:9f NAME=deploy `cat /home/dokku/.sshcommand` $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDD3HPvDnOu97rL7WR3B49Kjy8PViBLddpN1J9PdCajQBObhwG1xjXvo//r31Oq25oOtKAjXtQ8tH6a8NJfLwWkfdmncBBJAPGtWsJXmLzoSt3Oxn91I7j1fLeVxFI8JmF2QcrJkpYE4rytV6r/onLe2DeVcvbJ6MZa+b6uE4u8QHnOckH89gJkWgIBt3MuvhGHrWK23wyJpV7GirxC8KxuG4hTO0hqVKnaOa9pwN6W4ntWwf5bqiuXfbvZGZdTlotE8C0hYINmUJrWzRtNKpycc1y3294cz1aJs2d1/+LWJTEvpv4l92jl1TPBtZnCRisOibFPOj0NA1YzlM/N4iON mose@momac
>
root@dokkudev:/home/dokku$ cat .sshcommand
/usr/local/bin/dokku
>
root@dokkudev:/home/dokku$ ll node-js-app/
total 60
drwxrwxr-x 8 dokku dokku 4096 Aug 13 12:34 ./
drwxr-xr-x 5 dokku root  4096 Aug 13 12:28 ../
drwxrwxr-x 2 dokku dokku 4096 Aug 13 12:28 branches/
drwxrwxr-x 3 dokku dokku 4096 Aug 13 12:28 cache/
-rw-rw-r-- 1 dokku dokku   66 Aug 13 12:28 config
-rw-rw-r-- 1 dokku dokku   65 Aug 13 12:28 CONTAINER
-rw-rw-r-- 1 dokku dokku   73 Aug 13 12:28 description
-rw-rw-r-- 1 dokku dokku   23 Aug 13 12:28 HEAD
drwxrwxr-x 2 dokku dokku 4096 Aug 13 12:28 hooks/
drwxrwxr-x 2 dokku dokku 4096 Aug 13 12:28 info/
-rw-rw-r-- 1 dokku dokku  526 Aug 13 12:34 nginx.conf
drwxrwxr-x 4 dokku dokku 4096 Aug 13 12:28 objects/
-rw-rw-r-- 1 dokku dokku    6 Aug 13 12:28 PORT
drwxrwxr-x 4 dokku dokku 4096 Aug 13 12:28 refs/
-rw-rw-r-- 1 dokku dokku   34 Aug 13 12:28 URL
>
root@dokkudev:/home/dokku$ cat node-js-app/nginx.conf
upstream node-js-app { server 127.0.0.1:49153; }
server {
 listen      80;
 server_name node-js-app.dokku.mose.com;
 location    / {
   proxy_pass  http://node-js-app;
   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
   proxy_set_header Host $http_host;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header X-Forwarded-For $remote_addr;
   proxy_set_header X-Forwarded-Port $server_port;
   proxy_set_header X-Request-Start $msec;
 }
}
>
root@dokkudev:/home/dokku$ docker ps
CONTAINER ID        IMAGE                      COMMAND                CREATED             STATUS              PORTS                     NAMES
8f4a1b892e9b        dokku/node-js-app:latest   /bin/bash -c '/start   11 hours ago        Up 11 hours         0.0.0.0:49153->5000/tcp   silly_ardinghelli
>
root@dokkudev:/home/dokku$ docker port 8f4a1b892e9b 5000
0.0.0.0:49153
>
That's it ...


 Tools used during this presentation
 
 Shellplay ... record shell session
               https://github.com/mose/shellplay
               gem install shellplay
     
 Tugboat ..... Digitalocean CLI
               https://github.com/pearkes/tugboat
               gem install tugboat && tugboat init
     
 Hub ......... Github git wrapper
               https://github.com/github/hub
               gem install hub
     
 Pygmentize .. code colorization
               http://pygments.org/docs/cmdline/
               pip install pygments


 About me
 
 Faria (is hiring) ... http://faria.co
    Devtips .......... http://devtips.faria.co
             
 Mose  ............... http://mose.com
    twitter .......... @mo5e
    github ........... mose
    Green Ruby ....... http://greenruby.org

    This presentation is downloadable at
    https://github.com/mose/20140814-dokku