Skip to content
Theory · Data: volumes and bind mounts · lesson 5 of 7

Bind mounts

A volume is good for a database: Docker itself decides where to keep its files, and you don't think about them. But sometimes you need the opposite. You edit a site's pages or a config file on your computer and want the container to see the new version at once, with no image rebuild and no copying. Docker has a second way to attach data to a container for this.

In this lesson

  • A computer's folder inside a container
  • Read-only: :ro
  • A third kind: tmpfs
  • A volume or a folder
  • Common mistake
  • Key points