Scenario:
-
Create a container providing some service under a non-published port, e.g. with the following docker-compose.yml:
version: '2'
services:
whoami:
image: containous/whoami:latest
command: "--port 8081"
Start the service using docker-compose --project-name whoami up -d.
-
Add the following to your WWTC-configuration:
[[wider_world_to_container.rules]]
network = "whoami_default"
dst_container = "whoami_whoami_1"
expose_port = "8081/tcp"
-
Signal DFW to reapply the rules (e.g. by restarting it).
-
Try to cURL the above container from within another container on the same host:
# docker container run --rm curlimages/curl -v http://<your host or IP>:8081
Status: Downloaded newer image for curlimages/curl:latest
* Trying <IP>:8081...
* connect to <IP> port 8081 failed: Connection refused
* Failed to connect to <your host or IP> port 8081: Connection refused
* Closing connection 0
curl: (7) Failed to connect to <your host or IP> port 8081: Connection refused
Since the container is exposed to the wider-world, I'd expect the container to also be reachable from other containers.
(Thanks to @cybermcm for reporting this.)
Scenario:
Create a container providing some service under a non-published port, e.g. with the following
docker-compose.yml:Start the service using
docker-compose --project-name whoami up -d.Add the following to your WWTC-configuration:
Signal DFW to reapply the rules (e.g. by restarting it).
Try to cURL the above container from within another container on the same host:
Since the container is exposed to the wider-world, I'd expect the container to also be reachable from other containers.
(Thanks to @cybermcm for reporting this.)