Skip to content

Instantly share code, notes, and snippets.

@cvhau
Last active January 29, 2021 10:35
Show Gist options
  • Save cvhau/e6841cbc4c623233a848563769a7f723 to your computer and use it in GitHub Desktop.
Save cvhau/e6841cbc4c623233a848563769a7f723 to your computer and use it in GitHub Desktop.
Guid to start a mariadb docker container

Create volume for persistence data storage

docker volume create mariadb-volume

The volume data is stored under the /var/lib/docker/volumes on your host.

Start a mariadb docker container

docker run -d --name mariadb -p 3306:3306 -e "MYSQL_ROOT_PASSWORD=YOUR_ROOT_PASSWORD" --restart unless-stopped -v mariadb-volume:/var/lib/mysql mariadb:latest

Don't forget to replace YOUR_ROOT_PASSWORD with your secret password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment