Nextcloud on WSL2 + docker using MySQL

I’d like to have nextcloud with a good performance for our group (4 people). Windows 10 is given with a dedicated IP address.

I have WSL 2 and docker installed. First, I installed mariaDB:

docker pull mariadb
docker run --detach --env MARIADB_USER=db_user --env MARIADB_PASSWORD=A_STR_PWD --env MARIADB_ROOT_PASSWORD=A_STR_PWD  mariadb:latest

Then I executed

docker pull nextcloud
docker run -d -p 8090:80 nextcloud

I started it with port 8090 bc 8080 is already used by IIS from Windows 10 for another service. The image name is nextcloud. On Windows, I can access the page http://localhost:8090/index.php

I enter the following details:

  • database user: db_user
  • database password: A_STR_PWD
  • database name: nc_db
  • database host: nextcloud

However, I get the error:

Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

Do I need start mariaDB differently? Do I need to use different settings for it, or for the nextcloud, or for the web installer?

nextcloud’s docker log:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 12 23:27:52.752613 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.52 (Debian) PHP/8.0.16 configured -- resuming normal operations
[Sat Mar 12 23:27:52.752656 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Sat Mar 12 23:49:24.018583 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.52 (Debian) PHP/8.0.16 configured -- resuming normal operations
[Sat Mar 12 23:49:24.018624 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
Initializing nextcloud 23.0.2.1 ...
Initializing finished
New nextcloud instance
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET / HTTP/1.1" 200 3505 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/css/guest.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 6165 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/img/actions/caret-white.svg HTTP/1.1" 200 680 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/js/dist/install.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 93633 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/js/dist/main.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 488151 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/img/background.png?v=2 HTTP/1.1" 200 10154 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/img/logo/logo.svg?v=1 HTTP/1.1" 200 1350 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/img/actions/toggle.svg?v=1 HTTP/1.1" 200 843 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:25 +0000] "GET /core/img/actions/info-white.svg?v=2 HTTP/1.1" 200 922 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:26 +0000] "GET /core/vendor/zxcvbn/dist/zxcvbn.js HTTP/1.1" 200 400231 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:26 +0000] "GET /core/img/favicon-touch.png HTTP/1.1" 200 4729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:28:26 +0000] "GET /core/img/favicon.ico HTTP/1.1" 200 3809 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
127.0.0.1 - - [12/Mar/2022:23:28:31 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.52 (Debian) PHP/8.0.16 (internal dummy connection)"
127.0.0.1 - - [12/Mar/2022:23:28:32 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.52 (Debian) PHP/8.0.16 (internal dummy connection)"
172.17.0.1 - - [12/Mar/2022:23:43:26 +0000] "GET /index.php/csrftoken HTTP/1.1" 200 3321 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:49:28 +0000] "GET / HTTP/1.1" 200 3321 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:49:29 +0000] "GET /core/css/guest.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 6165 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:49:29 +0000] "GET /core/js/dist/install.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 93634 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:49:29 +0000] "GET /core/img/favicon-touch.png HTTP/1.1" 200 4730 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:49:29 +0000] "GET /core/img/favicon.ico HTTP/1.1" 200 3810 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:53:34 +0000] "POST /index.php HTTP/1.1" 200 3492 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:54:25 +0000] "POST /index.php HTTP/1.1" 200 3526 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:54:35 +0000] "GET /core/js/dist/install.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 93633 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:57:56 +0000] "POST /index.php HTTP/1.1" 200 3521 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:58:14 +0000] "GET /index.php HTTP/1.1" 200 3320 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [12/Mar/2022:23:58:41 +0000] "POST /index.php HTTP/1.1" 200 3523 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:00:49 +0000] "GET / HTTP/1.1" 200 3325 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:01:17 +0000] "POST /index.php HTTP/1.1" 200 3492 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:03:27 +0000] "POST /index.php HTTP/1.1" 200 3497 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:03:34 +0000] "GET / HTTP/1.1" 200 3321 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:03:58 +0000] "POST /index.php HTTP/1.1" 200 3489 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:05:56 +0000] "POST /index.php HTTP/1.1" 200 3522 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:13:39 +0000] "POST /index.php HTTP/1.1" 200 3522 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:13:49 +0000] "GET /core/img/favicon-touch.png HTTP/1.1" 200 4729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:21:07 +0000] "GET /index.php/csrftoken HTTP/1.1" 200 3325 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:22:59 +0000] "POST /index.php HTTP/1.1" 200 3492 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:23:07 +0000] "GET / HTTP/1.1" 200 3317 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:24:02 +0000] "POST /index.php HTTP/1.1" 200 3491 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:24:23 +0000] "POST /index.php HTTP/1.1" 200 3527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:24:44 +0000] "POST /index.php HTTP/1.1" 200 3518 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:36:08 +0000] "GET /index.php/csrftoken HTTP/1.1" 200 3319 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:39:55 +0000] "GET /index.php/csrftoken HTTP/1.1" 200 3324 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
172.17.0.1 - - [13/Mar/2022:00:51:08 +0000] "GET /index.php/csrftoken HTTP/1.1" 200 3324 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"

maria’s docker log:

2022-03-13 01:02:15+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
2022-03-13 01:02:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-03-13 01:02:15+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
2022-03-13 01:02:15+00:00 [Note] [Entrypoint]: Initializing database files

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following command:

'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at https://mariadb.com/kb

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2022-03-13 01:03:04+00:00 [Note] [Entrypoint]: Database files initialized
2022-03-13 01:03:04+00:00 [Note] [Entrypoint]: Starting temporary server
2022-03-13 01:03:04+00:00 [Note] [Entrypoint]: Waiting for server startup
2022-03-13 01:03:05+00:00 [Note] [Entrypoint]: Temporary server started.
2022-03-13  1:02:17 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-03-13  1:03:04 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 103 ...
2022-03-13  1:03:04 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-03-13  1:03:04 0 [Note] InnoDB: Using transactional memory
2022-03-13  1:03:04 0 [Note] InnoDB: Number of transaction pools: 1
2022-03-13  1:03:04 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-03-13  1:03:04 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-03-13  1:03:04 0 [Note] InnoDB: Using Linux native AIO
2022-03-13  1:03:04 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-03-13  1:03:04 0 [Note] InnoDB: Completed initialization of buffer pool
2022-03-13  1:03:05 0 [Note] InnoDB: 128 rollback segments are active.
2022-03-13  1:03:05 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-03-13  1:03:05 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-03-13  1:03:05 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-03-13  1:03:05 0 [Note] InnoDB: 10.7.3 started; log sequence number 42173; transaction id 14
2022-03-13  1:03:05 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-03-13  1:03:05 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-03-13  1:03:05 0 [Warning] 'user' entry 'root@7055ce74b7ad' ignored in --skip-name-resolve mode.
2022-03-13  1:03:05 0 [Warning] 'proxies_priv' entry '@% root@7055ce74b7ad' ignored in --skip-name-resolve mode.
2022-03-13  1:03:05 0 [Note] mariadbd: ready for connections.
Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
2022-03-13  1:03:14 0 [Note] mariadbd (initiated by: root[root] @ localhost []): Normal shutdown
2022-03-13  1:03:14 0 [Note] InnoDB: FTS optimize thread exiting.
2022-03-13  1:03:15 0 [Note] InnoDB: Starting shutdown...
2022-03-13  1:03:15 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-03-13  1:03:15 0 [Note] InnoDB: Buffer pool(s) dump completed at 220313  1:03:15
2022-03-13  1:03:15 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2022-03-13  1:03:15 0 [Note] InnoDB: Shutdown completed; log sequence number 42185; transaction id 15
2022-03-13  1:03:15 0 [Note] mariadbd: Shutdown complete

2022-03-13  1:03:16 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 1 ...
2022-03-13  1:03:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-03-13  1:03:16 0 [Note] InnoDB: Using transactional memory
2022-03-13  1:03:16 0 [Note] InnoDB: Number of transaction pools: 1
2022-03-13  1:03:16 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-03-13  1:03:16 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-03-13  1:03:16 0 [Note] InnoDB: Using Linux native AIO
2022-03-13  1:03:16 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-03-13  1:03:16 0 [Note] InnoDB: Completed initialization of buffer pool
2022-03-13  1:03:17 0 [Note] InnoDB: 128 rollback segments are active.
2022-03-13  1:03:17 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-03-13  1:03:17 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-03-13  1:03:17 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-03-13  1:03:17 0 [Note] InnoDB: 10.7.3 started; log sequence number 42185; transaction id 14
2022-03-13  1:03:17 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-03-13  1:03:17 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-03-13  1:03:17 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-03-13  1:03:17 0 [Note] InnoDB: Buffer pool(s) load completed at 220313  1:03:17
2022-03-13  1:03:17 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-03-13  1:03:17 0 [Note] Server socket created on IP: '::'.
2022-03-13  1:03:17 0 [Note] mariadbd: ready for connections.
Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2022-03-13 01:03:14+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
2022-03-13 01:03:14+00:00 [Note] [Entrypoint]: Creating user db_user

2022-03-13 01:03:14+00:00 [Note] [Entrypoint]: Stopping temporary server
2022-03-13 01:03:16+00:00 [Note] [Entrypoint]: Temporary server stopped

2022-03-13 01:03:16+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.