Exposing the HOST IP to Docker Container in CapRover

220 Views Asked by At

I am running CapRover 1.10.1 with Docker 24.0.0 on Ubuntu 20. I am trying to setup smtp server with exim4, I have mapped port 25 to the host, but in the logs when a client connects I see the local ip address of the host (10.0.0.2) not the client actual IP address. I have tried to use PublishMode=host (with per-deployment js script) on the port but still the same result, here is service inspect output:

Resources:
Networks: captain-overlay-network
Endpoint Mode:  vip
Ports:
 PublishedPort = 25
  Protocol = tcp
  TargetPort = 25
  PublishMode = host
 PublishedPort = 25
  Protocol = udp
  TargetPort = 25
  PublishMode = host

Any ideas are welcome.

1

There are 1 best solutions below

0
On

It works now after restart of the host, I guess "did you try turn it off and on again" is perfect here.