Unable to Connect to Docker Desktop Container #635

Closed
opened 2023-09-17 22:36:53 +00:00 by bovive · 1 comment

Greetings,

I have three nodes running, two of which are under Docker Desktop containers (one Windows and one Ubuntu). I am unable to connect to the Docker Desktop Garage nodes using the ip address of the machine on my LAN. This is true even on the host machine itself.

For Example on the Host (or any LAN) machine I run:

docker exec -ti garage-garage-1 /garage -h thenodeid@192.168.1.1:3901 --rpc-secret thesecretkey status

It outputs:

Error: Unable to connect to destination RPC host. Check that you are using the same value of rpc_secret as them, and that you have their correct public key.
IO error: Connection refused (os error 111)

If I run on the host:

docker exec -ti garage-garage-1 /garage -h thenodeid@localhost:3901 --rpc-secret thesecretkey status

It outputs correctly and even shows the host address as 192.168.1.1:3901.

This is the garage.toml:

metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "lmdb"


replication_mode = "3"

block_size = 1048576

rpc_bind_addr = "[::]:3901"
rpc_public_addr = "192.168.1.1:3901"
rpc_secret = "secretkey"

[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = "s3.localhost"

[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.localhost"
index = "index.html"

[k2v_api]
api_bind_addr = "[::]:3904"

[admin]
api_bind_addr = "0.0.0.0:3903"
admin_token = "secretadminkey"

The docker-compose.yml file is:

version: "3"
services:
  garage:
    image: dxflrs/garage:v0.8.4
    network_mode: "host"
    restart: unless-stopped
    volumes:
      - /media/Storage/Garage/Config/:/etc
      - /media/Storage/Garage/meta:/var/lib/garage/meta
      - /media/Storage/Garage/data:/var/lib/garage/data

If I try to node connect from my working node (non Docker Desktop) to one of the other nodes, I receive the same error. If I try to connect from one of the Docker Desktop nodes to my non-Docker Desktop node it says that it connects, but the other node doesn't see it back when I run "garage status".

Any help or guidance would be greatly appreciated. Thanks very much!

Greetings, I have three nodes running, two of which are under Docker Desktop containers (one Windows and one Ubuntu). I am unable to connect to the Docker Desktop Garage nodes using the ip address of the machine on my LAN. This is true even on the host machine itself. For Example on the Host (or any LAN) machine I run: ``` docker exec -ti garage-garage-1 /garage -h thenodeid@192.168.1.1:3901 --rpc-secret thesecretkey status ``` It outputs: ``` Error: Unable to connect to destination RPC host. Check that you are using the same value of rpc_secret as them, and that you have their correct public key. IO error: Connection refused (os error 111) ``` If I run on the host: ``` docker exec -ti garage-garage-1 /garage -h thenodeid@localhost:3901 --rpc-secret thesecretkey status ``` It outputs correctly and even shows the host address as 192.168.1.1:3901. This is the garage.toml: ``` metadata_dir = "/var/lib/garage/meta" data_dir = "/var/lib/garage/data" db_engine = "lmdb" replication_mode = "3" block_size = 1048576 rpc_bind_addr = "[::]:3901" rpc_public_addr = "192.168.1.1:3901" rpc_secret = "secretkey" [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" root_domain = "s3.localhost" [s3_web] bind_addr = "[::]:3902" root_domain = ".web.localhost" index = "index.html" [k2v_api] api_bind_addr = "[::]:3904" [admin] api_bind_addr = "0.0.0.0:3903" admin_token = "secretadminkey" ``` The docker-compose.yml file is: ``` version: "3" services: garage: image: dxflrs/garage:v0.8.4 network_mode: "host" restart: unless-stopped volumes: - /media/Storage/Garage/Config/:/etc - /media/Storage/Garage/meta:/var/lib/garage/meta - /media/Storage/Garage/data:/var/lib/garage/data ``` If I try to node connect from my working node (non Docker Desktop) to one of the other nodes, I receive the same error. If I try to connect from one of the Docker Desktop nodes to my non-Docker Desktop node it says that it connects, but the other node doesn't see it back when I run "garage status". Any help or guidance would be greatly appreciated. Thanks very much!
Author

Fixed by running in bridge mode and defining ports in docker-compose.yml file.

Fixed by running in bridge mode and defining ports in docker-compose.yml file.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#635
No description provided.