homarr icon indicating copy to clipboard operation
homarr copied to clipboard

Docker module - multiple instances and remote connection

Open braukev opened this issue 2 years ago • 4 comments

Description

I would like to add multiple docker instances from different hosts, so I can interact with the containers from all my servers.

Priority

Medium (Would be very useful)

braukev avatar Aug 18 '22 10:08 braukev

This is too vague, please provide more info, context as to why and how

ajnart avatar Aug 18 '22 10:08 ajnart

As far as I know the current Docker module allows you to interact with Docker containers running on the same Docker instance. This works by adding the following: -v /var/run/docker.sock:/var/run/docker.sock

It would be nice to have the possibility to add multiple Docker instances (remote), so you can interact with containers from other hosts.

There is a Docker Remote API, which is also used by Portainer. Through the API you are able to remotely connect to Docker hosts.

braukev avatar Aug 18 '22 18:08 braukev

As far as I know the current Docker module allows you to interact with Docker containers running on the same Docker instance. This works by adding the following: -v /var/run/docker.sock:/var/run/docker.sock

It would be nice to have the possibility to add multiple Docker instances (remote), so you can interact with containers from other hosts.

There is a Docker Remote API, which is also used by Portainer. Through the API you are able to remotely connect to Docker hosts.

You didn't give me much info aha. What do you need to connect to a remote docker ?

ajnart avatar Aug 18 '22 19:08 ajnart

As far as I know the current Docker module allows you to interact with Docker containers running on the same Docker instance. This works by adding the following: -v /var/run/docker.sock:/var/run/docker.sock It would be nice to have the possibility to add multiple Docker instances (remote), so you can interact with containers from other hosts. There is a Docker Remote API, which is also used by Portainer. Through the API you are able to remotely connect to Docker hosts.

You didn't give me much info aha. What do you need to connect to a remote docker ?

Docker API could simply be opened on any port adding -H 0.0.0.0:2375 to /lib/systemd/system/docker.service on a host you want to expose the API. As mentioned before, Portainer is an example of an app, which actively uses Docker API to manage multiple docker hosts. Then it could be accessed by an http request e.g. http://host:2375/api_method. It would be a nice feature to be honest, especially for people who run multiple docker instances in several VMs.

andrii-kryvoviaz avatar Aug 19 '22 21:08 andrii-kryvoviaz