MariaDB in Synology Docker Container

Download the image

  1. Open the Docker application inside the DSM portal
  2. Select Registry in the left menu
  3. Use the search box on the right and search for mariadb
  4. Once the nextcloud image was found, right click it and choose Download this image
  5. You can select the version you want to download, default: latest
  6. 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.
  7. DSM will show a notification (top right) once the download has finished

Launch the image (create a container)

  1. Click on image in the left menu 
  2. On the right click on the next cloud image you just downloaded
  3. Click on Launch in the top menu
  4. In the popup window click on advanced settings
  5. Check enable auto-restart
  6. Under the port settings tab change Auto to a free port which is available on your NAS, like 3306
  7. Click on the environment tab
  8. 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:
  9. Change to the volume tab and click on add folder
    We will create a structure like this:
    docker
    - mariadb

    -- data
    -- config
  10. Select the docker folder and click create folder
  11. Give it the name mariadb
  12. The new folder mariadb should be selected. Click again on create folder and name it data 
  13. Click select
  14. Back in the advanced settings window you need to enter a mount path for your new folder data: /var/lib/mysql
     
  15. Finish the wizard

Adjust sql permissions 

  1. Open the Docker application inside the DSM portal
  2. Select Registry in the left menu
  3. Use the search box on the right and search for mariadb
  4. Once the nextcloud image was found, right click it and choose Download this image
  5. You can select the version you want to download, default: latest
  6. 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.
  7. DSM will show a notification (top right) once the download has finished