Deployments and Docker

Feb 9, 2017   #docker  #dokku  #fabox  #giply  #ripple  #deployment 

While I’ve built several deployment projects in the past (Fabox, Giply, Ripple), I’ve given it all up because of a little project called Docker that has taken the world by storm.

Dokku

It started with a project called Dokku. Dokku was similar to where I envisioned Ripple moving to as I started investigating integration with Docker (it used bash instead of Ruby for automating tasks). At the time, it relied heavily on Heroku buildpacks (the project now supports Dockerfiles). I like the idea of a buildpack, and in a future article, I’ll talk about some projects I’ve built in Docker that are very reminscient of the buildpack. But I also felt limited and had to implement some workarounds (like maintaining a fork of Dokku) to get some features working with the buildpacks.

Docker cloud services

However, Dokku did get me invested in the Docker ecosystem. I graduated from Dokku when I started building my own Dockerfiles. I did so initially as a replacement for building VMs in my local environment. As I became more proficient at building Docker images, I looked at replacing Dokku with Docker Hub and Docker Cloud.

Docker Hub is integrated with Github and Bitbucket, the two Git solutions that I use most. I use Github for all of my OSS projects and Bitbucket for all of my private projects. I can tie my accounts together and it will automatically build Docker images whenever I commit changes. I have Docker Cloud manage my server. It runs everything on that server as Docker containers, and it integrates with Docker Hub, so when it builds a new image, it deploys that image automatically to my server.

Docker for Mac

Docker has changed how I interact with my local environment. In the past, I may have installed a Homebrew package. These days I’ll frequently build a small Alpine-based Dockerfile to perform the same function. This is especially helpful if the package is a one-off function, or has a lot of dependencies. I’ve become very proficient with having disposable Docker containers run by simple to quite-complex bash scripts.

At the office, we are primarily a PHP and Java shop. Recently, we needed to integrate with an open-source Ruby project. We looked at several options, including JRuby. In the end, I built a Sinatra-wrapper around the project and created a Docker image. This made it possible for us to communicate with the project over standard HTTP and our DevOps guys could install the image wherever they wanted. And they didn’t have to learn how to install Ruby! It was fantastic!

Docker makes it not only possible to support one-off languages but it makes it easy!

Conclusion

Perusing my Github repos, it’s apparent that I’m very invested in this technology. Even for my open source projects that are not specifically Docker-related, I generally build a Docker image around it. You want to use my restclient, but don’t want to install Ruby? No problem!