Open Synchro opened 3 years ago
Hey 👋
Thanks for raising this.
I'm tempting to support another distribution but I love that this repo is a simple and lightweight DockerFile with the bare minimum for Laravel apps so Alpine feels like the ideal distribution to me.
I'll keep this open until — fingers crossed — a proper MySQL client becomes available for Alpine.
Thanks again. 🙂
Thanks. I have found a workaround, but it involves downgrading the security of the mysql client connection, so it's not ideal. Add this command arg to the mysql service in your gitlab-ci.yml file:
services:
- name: mysql:8.0
command: [ "--default-authentication-plugin=mysql_native_password" ]
Nice, thanks for the update! Let me know if this suddenly becomes achievable without the workaround. 😊
Because this image is based on Alpine, when asked to install MySQL client it actually installs MariaDB's instead. This is often a reasonable substitution, but here it's fatal.
The problem is that Laravel 8's schema dump restore process (which makes CI pipelines run so much faster) builds a command line for the
mysql
CLI client and uses it to import the schema. MariaDB's CLI client is incompatible with MySQL 8.0 due to lack of support for its default auth mechanism,caching_sha2_password
, so unless you also want to have to reconfigure your MySQL server (meaning you can't simply enable it usingservices: mysql:8.0
in your CI config) you have to disable schema dump and have your tests run slowly.It's only the MaraDB client that's the problem. This is tricky to fix for Alpine Linux because it does not have a real MySQL package, even though MySQL includes support for Alpine.
I've been looking through various Laravel/PHP focused images for CI, and nearly all seem to suffer this problem, so I'm hoping one will fix it!