How to Save Docker Data using Bind Mounts or Volumes

Database Star
Database Star
29.4 هزار بار بازدید - 2 سال پیش - 📝 Get my free SQL
📝 Get my free SQL Cheat Sheets: https://www.databasestar.com/get-sql-...
🎓 Learn and become confident in SQL: https://databasestar.mykajabi.com/sql...

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: How to Set Up Oracle Database with Do...
How to Set Up Docker with SQL Server: How to Set Up SQL Server Database wit...
How to Set Up Docker with MySQL: How to Set Up MySQL Database with Docker
How to Set Up Docker with PostgreSQL: How to Set Up a PostgreSQL Database w...

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
2 سال پیش در تاریخ 1400/12/03 منتشر شده است.
29,468 بـار بازدید شده
... بیشتر