-
I have successfully built my own Adminer Docker image that adds MongoDB PHP extension to the official Adminer Docker image: FROM adminer
USER root
RUN apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS && \
echo '' | pecl install mongodb && \
docker-php-ext-enable mongodb && \
apk del .phpize-deps-configure && \
chown -R adminer:adminer /var/www && \
find /var/www -type d -exec chmod 775 {} \;
USER adminer I know MongoDB PHP extension is working fine because my custom image contains some other PHP code that interacts with MongoDB without problems. » docker run --rm adminer-mongo php -m | grep mongo
mongodb However, when I run a container using my customized Docker image, the login page of Adminer does not show MongoDB as an option in the I can see the Docker container using my custom image includes the MongoDB driver » docker run --rm adminer-mongo ls -l plugins/drivers/mongo.php
-rw-rw-r-- 1 adminer adminer 12999 May 4 16:30 plugins/drivers/mongo.php If I try to enable mongo plugin using » docker run -p 8080:8080 --rm --name adminer -e 'ADMINER_PLUGINS=mongodb' adminer-mongo
Unable to find plugin file "mongodb".
» docker run -p 8080:8080 --rm --name adminer -e 'ADMINER_PLUGINS=drivers/mongodb' adminer-mongo
/usr/local/bin/entrypoint.sh: line 14: can't create plugins-enabled/001-drivers/mongodb.php: nonexistent directory Any idea of how to proceed? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
unfortunately the current state of the project does not seem to support loading driver plugins. i've managed to modify the plugin loading process for the adminer 5 image, but this is in no way, shape or form guaranteed to work for you. if you want, you can take a look at https://github.com/elgarfo/adminer-docker-mongodb. with these modifications i was able to load drivers (i.e. "mongo") and the normal plugins too. just a headsup: the "alpha" in the plugins name seems to be meaningful. when not giving a database name (or trying to list databases on the server), the container crashes for me complaining about "db_name" not being set. anyway, as i was trying to get it working to connect to an ancient mongo-version (4.4.), i had to eventually realize, that the plugin is not fit for such an old version. maybe it is still of use to you or s/o else. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot @elgarfo , with your modified files my Adminer now offers MongoDB as an option. I couldn't connect to my MongoDB Instance (Azure CosmosDB) but it's due to an unrelated SSL issue in the original image. In case it helps, to enable SSL support in LibMongoC, just update the
|
Beta Was this translation helpful? Give feedback.
unfortunately the current state of the project does not seem to support loading driver plugins.
i've managed to modify the plugin loading process for the adminer 5 image, but this is in no way, shape or form guaranteed to work for you.
if you want, you can take a look at https://github.com/elgarfo/adminer-docker-mongodb.
with these modifications i was able to load drivers (i.e. "mongo") and the normal plugins too.
i radically removed code from plugin-loader.php to make adminer use its own plugin loading methods.
just a headsup: the "alpha" in the plugins name seems to be meaningful. when not giving a database name (or trying to list databases on the server), the container crashes for me c…