Giter Site home page Giter Site logo

Comments (3)

clue avatar clue commented on July 22, 2024

I like the idea, does anybody feel like filing a PR? 👍 :)

Also, I suppose this is a duplicate of #1?

from docker-adminer.

mathroc avatar mathroc commented on July 22, 2024

It would be useful and yes I guess having #1 would solves this

however I have a few remarks: It's a bit of a PITA to parse those env variable if you don't know the name or type of service that are linked. It can be done ( eg: https://github.com/texthtml/docker-links ) but even then you'll still have to write heuristics to guess which database type it is ( so it might not work with non official database that could use different variable or defaults)

anyway I guess it would mean making a plugin for adminer (I've made a similar plugin at work to automatically connect to our databases but reading a configuration file instead of env vars)

do you think we could find some easier way to configure theses connections?

eg, using DSN like :

docker run \
  -e ADMINER_SOURCES=FIRST_DB,SECOND_DB \
  -e ADMINER_SOURCE_FIRST_DB=mysql:host=mysql;port=3307;dbname=testdb;username=root \
  -e ADMINER_SOURCE_SECOND_DB=pgsql:host=10.2.0.71;port=5432;dbname=testdb;user=bruce
  clue/adminer

note, here is the env vars availlable when linking a mysql container to adminer:

docker exec adminer env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=8d7fa8843d12
MYSQL_PORT=tcp://172.17.0.2:3306
MYSQL_PORT_3306_TCP=tcp://172.17.0.2:3306
MYSQL_PORT_3306_TCP_ADDR=172.17.0.2
MYSQL_PORT_3306_TCP_PORT=3306
MYSQL_PORT_3306_TCP_PROTO=tcp
MYSQL_NAME=/adminer/mysql
MYSQL_ENV_MYSQL_ALLOW_EMPTY_PASSWORD=true
MYSQL_ENV_GOSU_VERSION=1.7
MYSQL_ENV_MYSQL_MAJOR=5.7
MYSQL_ENV_MYSQL_VERSION=5.7.12-1debian8
HOME=/root

depending on the situation even harder than the database it could be difficult to guess the username, password and database to use

from docker-adminer.

f3l1x avatar f3l1x commented on July 22, 2024

I'm maybe wrong, but predefined connections are stored in session/cookie. Aren't they?

selection_002

from docker-adminer.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.