Thanks for reporting in! Glad it works
I assume the first mistake was mounting the wrong volume, when MariaDB starts, it will “prepare” files, so somewhere, the permissions didn’t save, and when you issued the docker restart mariadb
, the database did not have persistent storage, so it restarted into a “fresh” container (thus the permission errors, librenms
does not exist)
Restart
If you still have time, you might want to revisit the copy/paste commands? Like change to your password, and timezone (you will need to clear the containers again though, as listed above)
The official docs saves the runtime config in a file, if we do -e in docker, it means it’s a environment variable in Linux. MariaDB docker do not read the environment variable above, so you would be starting mariadb without those arguments
Because it’s a docker container, they have a few environment variables you can set via the container, but not the above. You can see the EV they allow on the MariaDB docker page
Because the Container EV does not include innodb_file_per_table , etc etc, the tutorial run them as arguments when MariaDB starts up in the container
MariaDB docker build tag @ latest
see last line of 23 CMD ["mariadbd"]
The double --
, are the arguments when starting MariaDB. The MariaDB container already runs mariadbd
default, so putting these two arguments will result in mariadbd --argument1 --argument2
Tutorial should be easy
As a tutorial, I made things simple so that its easy to copy/paste, you can definitely make your own MariaDB config file, and then point the Docker container to read the config file for MariaDB container
docker run --name some-mariadb -v /my/custom:/etc/mysql/conf.d --rm mariadb:latest my_print_defaults --mysqld
The -v
-v /my/custom:/etc/mysql/conf.d
Inside /my/custom should be a my_custom_config.cnf
, which should include the config for
# my_custom_config.cnf
# # check the proper config syntax to set these arguments
innodb_file_per_table=1
lower_case_table_names=0
so the tutorial docker run command will become:
docker run \
-v /volume1/docker/mariadb:/var/lib/mysql \ # the persistent storage
-v /my/custom:/etc/mysql/conf.d \ # the custom config folder
-e MYSQL_ROOT_PASSWORD='root_password' \
-e TZ=Asia/Singapore \
--name mariadb \
-d \
--restart always \
mariadb:latest
Hope that helps clear up some docker usage