In this video, we'll explore how persistent storage works in Docker and what happens to data after a container is deleted. Using practical examples, I'll show the difference between Docker Volumes and Bind mounts, where Docker stores volumes, how to declare a VOLUME in a Dockerfile, how to mount storage using docker run -v, and which commands to use to manage volumes: docker volume ls, docker volume inspect, docker volume rm. This video is perfect for anyone learning Docker, DevOps, and Kubernetes and wanting to properly store logs, application data, and databases in containers.
00:00 Let's go
01:15 How to avoid losing data in a container?
02:47 Benefits of using Docker Volume
03:52 How to use Docker Volume in a Dockerfile
05:02 Example of using Docker Volume in mariadb
05:31 How to check which Volume a container is using
09:25 Docker Volume sharing
14:26 When to use Docker Volume sharing
16:52 About Bind Mount
19:01 Example of using Bind Mount