Multiple databases with the official MariaDB docker image.
Inspired by docker-postgresql-multiple-databases
- Clone the repository
- Mount the repository as a volume to
/docker-entrypoint-initdb.d
- Set the
MYSQL_MULTIPLE_DATABASES
environment variable to be comma-seperated database names
mariadb:
image: mariadb:10.4.12
volumes:
- ../docker-mariadb-multidb:/docker-entrypoint-initdb.d
environment:
...
- MYSQL_ROOT_PASSWORD=
- MYSQL_MULTIPLE_DATABASES=db1,db2