From the course: Docker for Developers: Create and Manage Docker Containers
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Comparing Docker volumes and bind mounts - Docker Tutorial
From the course: Docker for Developers: Create and Manage Docker Containers
Comparing Docker volumes and bind mounts
- [Narrator] When working with Docker, you'll eventually need to manage data that lives outside your containers. That's where volumes and bind mounts come in. They both let your containers interact with data on the host system, but they work a bit differently and are best suited for different situations. Volumes are managed by Docker itself. When you create a volume, Docker takes care of where it lives on your host machine. You don't need to worry about the path, just the name. Volumes are ideal when you want data to persist independently of the container, and you don't need to directly interact with the files from your host system. They're stored in Docker's internal directory, and can easily be backed up or shared between containers. Use a volume when you want your app's database to keep its data between container restarts, or you're deploying to a server and want Docker to manage storage cleanly. Or you want to share…
Contents
-
-
-
-
-
-
-
(Locked)
Comparing Docker volumes and bind mounts2m 2s
-
(Locked)
Using a Docker volume4m
-
(Locked)
Using a bind mount3m 1s
-
(Locked)
Creating a custom network4m 16s
-
(Locked)
Challenge: Working with persistent storage and networks1m
-
(Locked)
Solution: Working with persistent storage and networks2m 5s
-
(Locked)
-
-
-
-