Hello Community,
As you could guess from the topic I could use some help to get Nextcloud and MariaDB up and running using a podman-pod(1). But first things first, let me explain what I’m trying to accomplish.
I’m trying to build an ansible role that utilizes the containers.podman collection to deploy a Nextcloud instance and a MariaDB database. Both services should run as containers in a pod (in a rootless podman installation). The ansible role is work in progress. You’ll find it here on GitHub. To build it I’ve used the following documentation:
- GitHub nextcloud/docker
- Docker Hub nextcloud
- Docker Hub mariadb
- Ansible collection containers.podman
All neccessary variables should be defined in defaults/main.yml and I thought everyting was ready to deploy a working Nextcloud instance. But the Nextcloud container has an issue to connect to the database. The logs show the following error:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
In the First use section I’ve found a hint to change the values for MYSQL_DATABASE and MYSQL_HOST to ‘db’. I’ve done that, but now I get the following error instead.
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: Name or service not known
I thought using a pod would enable the Nextcloud container to communicate with the MariaDB contianer via localhost:3306, wouldn’t it?
Does someone have an idea where I made a mistake?
Regards,
Tronde