Containers for continuous integration
(in science)

Frederick “Erick” Matsen

Welcome to
the future

  • Code under version control
  • Example inputs included in repository
  • Code compiles
  • Code runs on example inputs
  • Code does the right thing on example inputs

What do the
pros do?

Check out pull requests for Rails
and click on the little s and s.


Uh oh, one of my builds is failing.
No cowsay????


Scientific workflows are complex


Docker enables us to bring together lots of working parts, unusual languages, and heavy dependencies.


FROM ubuntu:trusty

RUN apt-get update -q && \
    apt-get install -y -q --no-install-recommends \
        ca-certificates \
        cowsay \
        git \

RUN ln -s /usr/games/cowsay /usr/bin

CMD git clone && \
    cd p-neq-np && \

Try this

git clone
cd cowsay-build-env/
docker build -t $USER/cowsay-build-env .
docker images
docker run -t $USER/cowsay-build-env
docker run -it $USER/cowsay-build-env /bin/bash


  • Exit from your container
  • Install nyancat with apt-get in your Dockerfile
  • Build your container (same command as before)
  • Run it from within your container (same as before)

Docker hub

Either push directly:

docker push $USER/cowsay-build-env


Or set up an automated build as I have for this project:

We could stop here!

In fact, I wrote a little shim that would post to our Slack channel with the results of an automated build.

But, there are tools that make the process smoother and more logical, such as Wercker.


Specify the Docker image used for the build:

box: matsen/cowsay-build-env


Specify what the build should do:

        - script:
            name: build
            code: make

When pushed to Wercker, you get a build page like this.

More fun


        - slack-notifier:
            url: $SLACK_URL
            channel: microbiome
            username: pplacer build

Upload docs to Github pages:

        - ematsen/gh-pages:
            token: $GITHUB_TOKEN
            repo: matsen/pplacer
            path: docs/_build/html

YAML is great*




* and a little fussy to debug. Use