Skip to main content

Introduction

Hey!

My goal here is to get you up and running hosting nontrivial web applications on the public-facing Internet, mostly by using Docker. Hopefully, you can go from "I hacked together an application that runs locally" to "I hacked together an application that's accessible over the web". This isn't exactly the typical orientation of a "Docker guide", which might take more seriously the task of teaching you how to use Docker in the general case. I just want to get you started with a good-enough default workflow (one you understand reasonably well) that you can use for future applications, even if it's not a perfect setup. If you care enough, you'll end up discovering your own workflow over time.

There are a few things I'll assume you know already, like how to use git and a terminal. You should also know how to build the web application you want to serve in the first place, like with Express or Flask or whatever. If I'm talking over your head at any point, try skipping the paragraph (I'm probably rambling anyway) before giving up on the whole section. I am assuming a pretty high general technical expertise, though.

In fact, the audience I had in mind while I wrote this guide was the fellow human-computer interaction researcher who occasionally needs to deploy toy prototypes to the web (to run a user study or something). If you're not a human-computer interaction researcher, you should become one before reading this guide. It's great fun! Or you could just pretend you are one already, I won't notice.

Anyway, the point is that this guide probably isn't what you're looking for if, say, you just joined a software engineering team that uses Docker and want to understand what's going on. That would mean you probably have a few big apps instead of a bunch of little apps. Your team also probably cares a little more than I do about doing things right instead of just getting them working in a simple way. The audience I'm writing for is the prototyper who maybe averages a new project every two months (like I seem to have done over the last decade) and isn't trying to build a website that more than a handful of people will use at a time.

I’ll mostly assume you’re running Linux on your computer(s) – those you use both for development and any deployment you end up doing – and that you already have Docker Engine installed locally, but in a separate section, I explain a little of what you’ll need to know if you’re using Windows or macOS on your personal computer. Things get a little tricker in that case, but most of the basic information is the same.

A note about this guide website

note

Make sure this isn't cut off on your screen!

The current layout for this guide is one that assumes that your screen is wide enough to accommodate a second column of callouts, like the one to the right of this paragraph. If you don't see it, or if it's cut off, your best bet for now is probably just to zoom out in your web browser. Reading in a mobile browser is probably also not practical at the moment.

Why learn Docker?

In practice, the main thing you’ll get out of Docker, especially if you’re learning it for the kind of thing we HCI researchers do, is that you won’t have to spend as much time wrangling application dependencies as you do in a Docker-free world. There are other things Docker can help you do, like isolate applications from each other or do some lightweight routing of network traffic, but mostly the motivation is about dependencies. Head to the next section to see what I mean.