This Docker image provides a simple way to run MariaDB, a popular open-source relational database server created by the original developers of MySQL. Maintained by the LinuxServer.io team, this container is designed for ease of use, security, and regular maintenance.
The image comes with several key benefits inherent to the LinuxServer.io ecosystem:
PUID and PGID variables to avoid permission issues.Configuration is straightforward using environment variables to set the root password, create an initial database, and define a user. For more advanced setups, you can bootstrap a new instance by placing .sql files in the /config/initdb.d/ directory, which will be executed on the first run. The container also includes tools like mariadb-check for database maintenance and repair.
services:
mariadb:
image: lscr.io/linuxserver/mariadb:latest
container_name: mariadb
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
- ./config:/config
ports:
- 3306:3306
restart: unless-stoppedMYSQL_ROOT_PASSWORD=your_super_secret_root_password
MYSQL_DATABASE=my_database
MYSQL_USER=my_user
MYSQL_PASSWORD=your_super_secret_passwordAuto-fetched about 20 hours ago
Auto-fetched about 20 hours ago