original sources: https://github.com/TimWolla/docker-adminer/tree/51202fad34e0f5ec140451e9b6bdba9d1068e329
setting ADMINER_PLUGINS=drivers/mongo does not work. loading other plugins from plugins/ works fine.
after disabling the sanity check in line 8 of plugin-loader.php, entrypoint.sh complains because it cannot write to directory plugins-enabled/001-drivers/. which is nothing to wonder about, as it does not exist. and even if that is fixed (by creating it beforehand), then plugin-loader.php will refuse to load the plugin because it contains more than one class.
adminer comes with its own plugin loading methods. if \Adminer\Plugins is instanced with null as parameter, it will load plugins automatically from adminer-plugins directory.
so i decided to:
- change the plugin loading code in index.php and let adminer load plugins by itself. (see index.php line 26)
- change entrypoint.sh to only call plugin-loader.php with the plugin name as parameter. (see entrypoint.sh line 14)
- remove all the previous plugin-loader.php code (apart from the sanity checks at the top), and replace it with code that symlinks plugins-files from plugins/ to adminer-plugins/
- add mongodb php extension installation commands to Dockerfile
using the demo compose.yml, and starting the container with docker compose up -d adminer, i can now successfully connect to mongodb and use other plugins too.