Back to Browse

How to Save Docker Data using Bind Mounts or Volumes

38.0K views
Feb 22, 2022
13:41

📝 Get your FREE cheat sheet of Docker commands: https://databasestar.mykajabi.com/lpkj-docker-cheat-sheet/?video=-pzptvcJNh0 🎓 Master SQL Fundamentals: https://databasestar.mykajabi.com/sql-simplified/?video=-pzptvcJNh0 Using Docker for a database is common during development. It’s easy to set up, and it’s available for many different types of databases. One drawback is that the data is not saved when the container is removed. However, there are two methods that can be used to save data in Docker if a container is removed. These methods are Volumes and Bind Mounts. In this video, I’ll explain what they are and show you how to set up a container to use each of them. We’ll use a MySQL database to demonstrate that the database is saved between containers, but this works on many different databases. This video assumes you have Docker set up already. If not, you can check out any of my other videos: How to Set Up Docker with Oracle: https://www.youtube.com/watch?v=OTglm9fVCL4 How to Set Up Docker with SQL Server: https://www.youtube.com/watch?v=TUWItrX7hmA How to Set Up Docker with MySQL: https://www.youtube.com/watch?v=kphq2TsVRIs How to Set Up Docker with PostgreSQL: https://www.youtube.com/watch?v=RdPYA-wDhTA Timestamps: 00:00 Introduction 00:16 Docker storage options 01:05 Definitions 01:40 Prerequisites for this video 02:02 Option 1: Create volume 03:00 Docker run with volume 04:35 Add data to database 06:16 Remove and create new container 08:42 Option 2: Create bind mount 09:26 Docker run with bind mount 10:54 Add data to database 11:58 Remove and create new container

Download

0 formats

No download links available.

How to Save Docker Data using Bind Mounts or Volumes | NatokHD