Skip to content

Instantly share code, notes, and snippets.

@crittermike
Created June 6, 2017 16:24
Show Gist options
  • Save crittermike/4c43a63a6b1cd3f0d5f06677244ae721 to your computer and use it in GitHub Desktop.
Save crittermike/4c43a63a6b1cd3f0d5f06677244ae721 to your computer and use it in GitHub Desktop.
Examples of volumes in docker-compose.yml
volumes:
# Just specify a path and let the Engine create a volume
- /var/lib/mysql
# Specify an absolute path mapping
- /opt/data:/var/lib/mysql
# Path on the host, relative to the Compose file
- ./cache:/tmp/cache
# User-relative path
- ~/configs:/etc/configs/:ro
# Named volume
- datavolume:/var/lib/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment