How to use Bitnami/moodle for DSM7 in Synology?

  bitnami, docker, moodle, mysql, synology
  1. DSM7 of Synology does not allow moodle, which I have to use heavily for my classes.
  2. I’m going to implement moodle in Synology NAS (DS918+) by the docker bitnami containers.
  3. The following is the docker-compose.yml, modified from the original bitnami/moodle.
version: '2'

services:
  mariadb:
    image: 'bitnami/mariadb:latest'
    container_name: mariadb
    environment:
      MARIADB_ROOT_PASSWORD: 1111
      MARIADBL_DATABASE: moodle
      MARIADB_USER: moodle
      MARIADB_PASSWORD: 1234
    volumes:
      - /volume2/db_maria:/var/lib/mysql

  moodle:
    image: 'bitnami/moodle:latest'
    container_name: moodle
    environment:
      MOODLE_USERNAME: user
      MOODLE_PASSWORD: 12345678
      MARIADB_HOST: mariadb
      MARIADB_PORT_NUMBER: 3306
      MOODLE_DATABASE_USER: moodle
      MOODLE_DATABASE_NAME: moodle
      MOODLE_DATABASE_PASSWORD: 1234
    ports:
      - '8880:8080'
      - '8443:8443'
    volumes:
      - /volume2/db_moodle:/bitnami
    depends_on:
      - mariadb

volumes:
  mariadb_data:
    driver: local
  moodle_data:
    driver: local
  1. The following is the response of "docker-compose up".
Creating network "workmoodle_default" with the default driver
Creating mariadb ... done
Creating moodle  ... done
Attaching to mariadb, moodle
mariadb    | mariadb 15:31:26.58
mariadb    | mariadb 15:31:26.58 Welcome to the Bitnami mariadb container
mariadb    | mariadb 15:31:26.59 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mariadb
mariadb    | mariadb 15:31:26.59 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mariadb/issues
mariadb    | mariadb 15:31:26.60
mariadb    | mariadb 15:31:26.60 INFO  ==> ** Starting MariaDB setup **
mariadb    | mariadb 15:31:26.81 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
moodle     | moodle 15:31:29.97
mariadb    | mariadb 15:31:26.98 INFO  ==> Initializing mariadb database
mariadb    | mariadb 15:31:27.07 INFO  ==> Updating 'my.cnf' with custom configuration
mariadb    | mariadb 15:31:27.46 INFO  ==> Setting user option
moodle     | moodle 15:31:29.98 Welcome to the Bitnami moodle container
moodle     | moodle 15:31:29.98 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-moodle
moodle     | moodle 15:31:29.98 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-moodle/issues
moodle     | moodle 15:31:29.99
moodle     | moodle 15:31:29.99 INFO  ==> ** Starting Moodle setup **
mariadb    | mariadb 15:31:27.85 INFO  ==> Installing database
moodle     | moodle 15:31:31.19 INFO  ==> Configuring PHP options
moodle     | moodle 15:31:31.35 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
moodle     | moodle 15:31:33.13 INFO  ==> Ensuring Moodle directories exist
moodle     | moodle 15:31:33.65 INFO  ==> Trying to connect to the database server
mariadb    | mariadb 15:31:42.21 INFO  ==> Starting mariadb in background
mariadb    | mariadb 15:31:44.30 INFO  ==> Configuring authentication
mariadb    | mariadb 15:31:44.89 INFO  ==> Running mysql_upgrade
moodle     | moodle 15:32:35.63 ERROR ==> Could not connect to the database
moodle exited with code 1
mariadb    | mariadb 15:32:44.73 INFO  ==> Stopping mariadb
mariadb    | mariadb 15:32:47.80 INFO  ==> ** MariaDB setup finished! **
mariadb    |
mariadb    | mariadb 15:32:47.91 INFO  ==> ** Starting MariaDB **
mariadb    | 2021-07-05 15:32:47 0 [Note] /opt/bitnami/mariadb/sbin/mysqld (mysqld 10.5.11-MariaDB) starting as process 1 ...
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Uses event mutexes
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Number of pools: 1
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
mariadb    | 2021-07-05 15:32:48 0 [Note] mysqld: O_TMPFILE is not supported on /opt/bitnami/mariadb/tmp (disabling future attempts)
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Using Linux native AIO
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Completed initialization of buffer pool
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: 128 rollback segments are active.
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: 10.5.11 started; log sequence number 45118; transaction id 20
mariadb    | 2021-07-05 15:32:48 0 [Note] Plugin 'FEEDBACK' is disabled.
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
mariadb    | 2021-07-05 15:32:48 0 [Note] Server socket created on IP: '0.0.0.0'.
mariadb    | 2021-07-05 15:32:48 0 [Note] InnoDB: Buffer pool(s) load completed at 210705 15:32:48
mariadb    | 2021-07-05 15:32:48 0 [Warning] 'proxies_priv' entry '@% [email protected]' ignored in --skip-name-resolve mode.
mariadb    | 2021-07-05 15:32:48 0 [Note] Reading of all Master_info entries succeeded
mariadb    | 2021-07-05 15:32:48 0 [Note] Added new Master_info '' to hash table
mariadb    | 2021-07-05 15:32:48 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
mariadb    | Version: '10.5.11-MariaDB'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution

  1. What is the problem with my code? The mariadb seems to be working but moodle cannot access it.
  2. Thanks in advance for your guide.

Source: Docker Questions

LEAVE A COMMENT