The following are some lessons I've learned from stumbling around with volumes and mountpoints in Docker. At the outset let me be clear that there is no new information here -- everything described below can be found in the user documentation in one form or another. However, I spent a bunch of time screwing things up for lack of context, so I am recording some of my lessons here so I can find them again.
There are broadly two ways external filesystems can be attached to a container:
- As a pass-through to an existing filesystem on the host. This is what Docker calls a "bind mount", and it basically