francescou / docker-compose-ui

web interface for Docker Compose
http://francescou.github.io/docker-compose-ui
MIT License
1.54k stars 228 forks source link

Multiple Contemporary Hosts #79

Open riccardotommasini opened 7 years ago

riccardotommasini commented 7 years ago

Add the opportunity to connect multiple hosts at the same time

francescou commented 7 years ago

I guess you would like to define multiple docker endpoints and then switch between them. This could be implemented but there would be a limitation: once you've changed docker endpoint the modification also applies to every other user connected to the same docker-compose-ui webapp.

This happens because the current implementation of docker-compose-ui to set a remote docker host is based on the DOCKER_HOST env, just like the docker-compose cli.

riccardotommasini commented 7 years ago

If I understood, you mention a sort of docker host bookmarks that are also manageable from the UI. That would be enough for me.

I have also a question, how are you interacting with docker-compose. I imagine you import it as a library then you wrap the API to for a programmatic usage.

Would be possible to integrate this behavior with Docker-Py and instantiate client "manually": docker.DockerClient(base_url='host:port')

IDK if in this way you can keep the 100% compatibility with compose API though.

francescou commented 7 years ago

Hi @riccardotommasini I think you're right. I am actively investigating on how to implement this feature.

francescou commented 7 years ago

it should be quite easy to instantiate different clients to multiple docker hosts, my only concern is where to store the hosts list (since docker-compose-ui does not depend on a database).

riccardotommasini commented 7 years ago

Sounds naive, but I think you can keep them in memory as it is right now.

bergtwvd commented 7 years ago

For persistence, how about a json format file in a directory that can be mounted on the host OS ?