docking-station icon indicating copy to clipboard operation
docking-station copied to clipboard

[Feat Request] Be able to add remote docker server thru docker API (port 2375/2376)

Open edersong opened this issue 1 year ago • 9 comments

It will be awesome if we can add external docker server thru docker API (ports 2375 or 2376) like Portainer or Dozzle

edersong avatar Jul 12 '24 15:07 edersong

I agree or be able to connect to multiple remote docker hosts.

bryceprutsos avatar Sep 20 '24 20:09 bryceprutsos

+1 to this idea

pjosuah avatar Sep 27 '24 11:09 pjosuah

greatly appreciated +1

Nickous avatar Oct 11 '24 08:10 Nickous

I've made a small modification to the python_on_whales docker client I'm using in the backend.

Unfortunately I don't have a proper remote docker host to test this on,
But according to python_on_whales docs, it should work as expected.

Use the new loolzzz/docking-station:dev tag
and add the following to /app/config/settings.yml file:

server:
  ...

  python_on_whales__docker_client_config:
    # https://gabrieldemarmiesse.github.io/python-on-whales/docker_client/
    host: unix:///var/run/docker.sock  # or whatever else docker host you want here

Let me know if this works so I can move this to the main branch.


CC
@edersong @bryceprutsos @princejosuah @Nickous

LooLzzz avatar Oct 11 '24 11:10 LooLzzz

Unfortunately it doesn't work for me with for example host: tcp://192.168.1.42:2375

Famku avatar Oct 19 '24 10:10 Famku

Hi, doesn't work for me either. Here are the relevant logs from the container:

[SERVER] ValidationError: 1 validation error for AppSettings [SERVER] server.python_on_whales__docker_client_config [SERVER] Input should be a valid dictionary [type=dict_type, [SERVER] input_value=['host=tcp://REMOTE_IP:2375'], input_type=list] [SERVER] For further information visit https://errors.pydantic.dev/2.9/v/dict_type [SERVER] NODE_ENV=production fastapi run src/app/api/main.py --port 3001 exited with code 1

I'm not a dev, but the error seems linked to the way the remote host is declared. I've checked the python_on_whales docs on DockerClient, and apparently host is expecting a string value.

A bit lost, but I hope this helps.

pjosuah avatar Oct 20 '24 09:10 pjosuah

I have no error message in the logs?!

Famku avatar Oct 20 '24 09:10 Famku

I checked again with another installation and now it's working

Thanks for your work

Famku avatar Nov 19 '24 08:11 Famku

next question, how to add multiple hosts?

It doesn't work with another line of host: tcp://192.168.1.x:2375 or host: tcp://192.168.1.x:2375, tcp://192.168.1.x:2375

Famku avatar Nov 19 '24 08:11 Famku