Welcome

I am a software engineer, and long-time proponent of Go. This site hosts some of the blog entries I've written over the years, along with details about some of the projects I've created, and write-ups from interesting problems I've solved.

This page is primarily for my benefit, but hopefully somebody else will find it useful as well!

General Notes

Open Sourceable Dockerfiles

I always like sharing what I do with other people. That’s part of what I love about the internet. Thus, I try to make my Dockerfiles reusable by anyone. I also don’t want to include anything in my Dockerfiles that I would consider sensitive or overly site-specific, like paths to my data volumes. Here are some tips on making release-ready Dockerfiles.

Container Script

One of the easiest ways to make a Dockerfile easy to customize is to build a shell script for building and running the container. The commands you’d use are discussed below, but here is a template for you to start:

In your READMEs, you can easily instruct your users to configure the container with simple commands like

echo PORT=2368 >> ./container.cfg

Entrypoint Script

Let’s face it, development and deployment are two very different beasts. For development, I typically make sure that the base container image (with no volumes mounted) has everything necessary to play around. This is also useful for writing integration testing scripts, because they can start from a clean slate each time.

Container Management

Starting and Stopping

Since I use data volumes copiously (see below), I have never really found myself reusing containers. I will usually make a shell script that collects the most common actions for my particular project.

Persistent Data

Dockerfiles

Self-signed Certificates

Often you will find yourself in need of a self-signed certificate as a part of your base image. I discovered that you can do this noninteractively with one command:

RUN openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -subj '/CN=localhost' -days 365

This is not something you want to serve publicly, of course, but it is a great one-liner nevertheless.