IBM-ICP-CoC/qod-db

Dockerfile fails on ROKS cluster

Closed this issue · 1 comments

Hi,
I was using Dockerfile to create a app on openshift v4.9 and i get the following error...
Build succeeds but Pods fails with the below logs...

2022-05-16 15:17:40+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
2022-05-16 15:17:40+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-05-16 15:17:40 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 1 ...
2022-05-16 15:17:40 0 [Warning] Can't create test file /var/lib/mysql/qod-db-dockerfile-6ffcf9fcdc-v9xv7.lower-test
2022-05-16 15:17:40 0 [ERROR] mariadbd: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied")
2022-05-16 15:17:40 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
2022-05-16 15:17:40 0 [ERROR] Aborting

Solution is to use the below command to enable 'anyuid' perms to the openshift project where the qod-db is being deployed. This is because the mariadb docker image needs root permission to run which openshift disables by default unless 'anyuid' is used.
oc adm policy add-scc-to-user anyuid -z default