Skip to content

Docker hub documentation: "Where to Store Data" options are not clear #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
barrystaes opened this issue Aug 14, 2017 · 1 comment
Closed
Labels
question Usability question, not directly related to an error with the image

Comments

@barrystaes
Copy link

barrystaes commented Aug 14, 2017

The "Where to Store Data" section in the MariaDB Docker Hub Page is not very clear to me.

The two mentioned options sound like the same thing but worded differently. I guess one of these options intends to describe using a docker volume for persistent data, and the other refers to mounting on host directly.
Also; the two links both are outdated and end up being redirected to https://docs.docker.com/engine/admin/volumes/volumes/

Where to Store Data
Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the mariadb images to familiarize themselves with the options available, including:

Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.

@wglambert
Copy link

By using volumes you get certain docker integrated functionality such as

Volumes are easier to back up or migrate than bind mounts.
You can manage volumes using Docker CLI commands or the Docker API.
Volumes work on both Linux and Windows containers.
Volumes can be more safely shared among multiple containers.
Volume drivers allow you to store volumes on remote hosts or cloud providers, to encrypt the contents of volumes, or to add other functionality.
A new volume’s contents can be pre-populated by a container.
https://docs.docker.com/storage/volumes/

In contrast:

Bind mounts are very performant, but they rely on the host machine’s filesystem having a specific directory structure available.
https://docs.docker.com/storage/bind-mounts/

When in doubt, the best all-around configuration is to use a modern Linux distribution with a kernel that supports the overlay2 storage driver, and to use Docker volumes for write-heavy workloads instead of relying on writing data to the container’s writable layer.
https://docs.docker.com/storage/storagedriver/select-storage-driver

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Development

No branches or pull requests

2 participants