DCSF 19 How Entergy is Mitigating Legacy Windows Operating System Vulnerabili...
Dockerizing Stashboard
1. Twilio San Francisco, CA 2013-11-13
Dockerizing Stashboard
Daniel Mizyrycki
daniel@docker.com
2. What is Stashboard?
Stashboard is Twilio's open-source status dashboard for APIs
and software services, powered by Google AppEngine
What is Docker?
Docker is an open-source project to easily create lightweight,
portable, self-sufficient containers from any application.
5. Data Dockerfile
# Smallest base image, just to launch a container
from busybox
maintainer Daniel Mizyrycki <daniel@docker.com>
# Create a regular user
run echo 'sysadmin:x:1000:1000::/data:/bin/sh' >> /etc/passwd
run echo 'sysadmin:x:1000:' >> /etc/group
# Create directory for that user
run mkdir /data
run chown sysadmin.sysadmin /data
# Add content to /data. This will keep sysadmin ownership
run touch /data/init_volume
# Create /data volume
VOLUME /data
6. Stashboard Dockerfile
# Base docker image
FROM ubuntu:12.04
MAINTAINER Daniel Mizyrycki <daniel@docker.com>
RUN echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' >
/etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y less wget bzip2 unzip python-pip ca-certificates
# Install stashboard and its dependencies
RUN mkdir /application; cd /application;
wget -q http://googleappengine.googlecode.com/files/google_appengine_1.8.7.zip;
unzip -q /application/google_appengine_1.8.7.zip; rm google_appengine_1.8.7.zip
RUN cd /application; wget -q -O - http://github.com/twilio/stashboard/tarball/master |
tar -zx --transform 's/[^/]*/stashboard/'
# create sysadmin account
RUN useradd -m -d /data sysadmin
# Define default server command
CMD ["/bin/sh", "-c", "/application/google_appengine/dev_appserver.py --skip_sdk_update_check
--host 0.0.0.0 --port 8080 --admin_host 0.0.0.0 --datastore_path=/data/docker-status.db
/application/stashboard/stashboard/app.yaml"]
7. Launch Docker
sudo docker -d &
Building containers
cd data; docker build -t data -rm .
cd stashboard; docker build -t stashboard -rm .
8. Create dockerized data container
docker run -name stashboard-data data true
Running stateful firefox with dockerized data container
docker run -u 1000 -volumes-from stashboard-data
-p 8080:8080 -p 8000:8000 stashboard
Submitting status from a service
curl -d message="Registry tests succeeded" -d status=up
http://localhost:8080/admin/api/v1/services/registry/events