Skip to content

Commit e18cad5

Browse files
committed
Add the slides about when to use volumes
[refs #04fb74d73636]
1 parent 5b31528 commit e18cad5

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Volumes vs bind mounts
2+
* bind mounts rely on the file system structure of the host
3+
* You need to manage them
4+
* The container has access to the files on the Docker host
5+
* Volumes are managed by Docker
6+
* Independent of the file system structure on the host
7+
* Easy to migrate and backup
8+
* Can be managed via the Docker client
9+
* Can be pre-populated with data from a container
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## When to use what?
2+
### bind mount
3+
* When you want to access the data from the host and the container
4+
* source code
5+
* configuration files
6+
7+
### Volume
8+
* When you want to persist data from the container
9+
* When you want to share data between containers
10+
* backups
11+
* configuration
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Named vs anonymous volumes
2+
### Named Volume
3+
* You care about the data long-term
4+
* A database
5+
* Other services that persist data
6+
* You need to easily identify the volume
7+
* Reuse them
8+
* For backups
9+
* Migrate them
10+
11+
### Anonymous Volume
12+
* You don't care about the data long-term
13+
* Testing
14+
* When you need to share data between containers
15+
* using --volumes-from

0 commit comments

Comments
 (0)