Closed theory closed 11 months ago
https://mariadb.org/mariadb-server-docker-official-images-healthcheck-without-mysqladmin/
Try:
options: --health-cmd="healthcheck.sh --innodb_initialized" --health-interval=5s --health-timeout=2s --health-retries=3
ref: https://mariadb.com/kb/en/using-healthcheck-sh-script/
Note this works with 10.3(?)+ scripts. Note 10.3 and earlier are eol as far as MariaDB is concerned.
If you still aim for compatibility something like the following might work (I'm unsure of shell expansion in cmd:
options: --health-cmd="healthcheck.sh --innodb_initialized || mysqladmin ping --protocol=tcp" --health-interval=5s --health-timeout=2s --health-retries=3
I have a GitHub action that tests a number of versions of MariaDB, and recently tried to add v11; oddly, the build reports that the container fails to start:
I can see no error message, however. Here's what the service looks like:
It works well for all v10 images.