Up until recently, this blog ran on a CoreOS host at DigitalOcean. It still runs at DigitalOcean, but the process for updating the blog has changed.

Whenever I had to change something, I

  • logged in, either via SSH directly or with docker-machine,
  • pulled the Git repo,
  • rebuilt the Docker image, and
  • updated the container.

Not very elegant. Time for a change and simplification.

How am I doing it now? Easy…

  • Finish the blog post.
  • Create the Docker image that basically holds nginx and the content.
  • Push the Docker image to the Docker registry.
  • Wait a little.
  • Read the new blog post online.

How did I get there? Easy…

As a heavy user of docker-compose, everything came together using Docker Cloud and its service stacks. Instead of writing a docker-compose.yml, you create a very similar-looking docker-cloud.yml. I already had a virtual machine at DigitalOcean, so I linked my two accounts and got the docker-cloud client:

alias docker-cloud="docker run -it -v ~/.docker:/root/.docker:ro -v `pwd`:/root --rm dockercloud/cli"

A service can be set to redeploy, so whenever the image changes, the service container is updated with the new image.

All in all, creating the blog post is done entirely with Docker. I don’t need any Jekyll tooling on my Mac—only an editor to write the text and Docker itself.

Here are some commands that describe the workflow in more detail.

The initial creation of the service stack (the docker-cloud.yml is very similar to a docker-compose.yml):

docker-cloud stack create -f /root/docker-cloud.yml
docker-cloud stack start root

This can be done in one command, but I prefer two separate steps.

Whenever the service stack itself changes by modifying docker-cloud.yml, I only have to run—for example, when changing some configuration of the load balancer:

docker-cloud stack update root -f /root/docker-cloud.yml
docker-cloud service redeploy lb-prod

Why am I using a load balancer? Easy…

I run two containers serving two different versions of the blog: one is the live version you see now, and the other is a preview where I check drafts before finalizing them.

The load balancer checks the subdomain and routes the request to the corresponding container.

This is not exactly “true” continuous deployment. It ‘s continuous from the point of pushing the image, but not from source changes. Next, I ‘ll address that by using Docker Cloud ‘s build jobs.

Done for today!