MariaDB in Synology Docker Container
Download the image
- Open the Docker application inside the DSM portal
- Select Registry in the left menu
- Use the search box on the right and search for mariadb
- Once the nextcloud image was found, right click it and choose Download this image
- You can select the version you want to download, default: latest
- If you open the image menu von the left you will see an animated database logo next to your new image. It proofs that the download is in progress.
- DSM will show a notification (top right) once the download has finished
Launch the image (create a container)
- Click on image in the left menu
- On the right click on the next cloud image you just downloaded
- Click on Launch in the top menu
- In the popup window click on advanced settings
- Check enable auto-restart
- Under the port settings tab change Auto to a free port which is available on your NAS, like 3306
- Click on the environment tab
- Add a new variable named MYSQL_ROOT_PASSWORD and assign as value the password for the MYSQL root super user
Not doing so will end up in a cotinuous restart of the docker container.
Optional steps to access database files from outside:
- Change to the volume tab and click on add folder
We will create a structure like this:
docker
- mariadb
-- data
-- config
- Select the docker folder and click create folder
- Give it the name mariadb
- The new folder mariadb should be selected. Click again on create folder and name it data
- Click select
- Back in the advanced settings window you need to enter a mount path for your new folder data: /var/lib/mysql
- Finish the wizard
Adjust sql permissions
- Open the Docker application inside the DSM portal
- Select Registry in the left menu
- Use the search box on the right and search for mariadb
- Once the nextcloud image was found, right click it and choose Download this image
- You can select the version you want to download, default: latest
- If you open the image menu von the left you will see an animated database logo next to your new image. It proofs that the download is in progress.
- DSM will show a notification (top right) once the download has finished