+ cat docker-compose.yml
services:
web:
image: php:apache
extra_hosts:
- "host1:192.168.1.15"
- "host2:127.0.0.1"
+ docker-compose run web php -r 'file_get_contents("http://host1:8010")
&& print("OK!!!\n");'
Creating host_web_run ... done
OK!!!
+ docker-compose run web php -r 'file_get_contents("http://host2:8010")
&& print("OK!!!\n");'
Creating host_web_run ... done
Warning: file_get_contents(http://host2:8010): Failed to open stream: Connection refused in Command line code on line 1
How to see
host1 work
host2 not work
Why?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 299 |
Nodes: | 16 (3 / 13) |
Uptime: | 64:17:32 |
Calls: | 6,691 |
Calls today: | 1 |
Files: | 12,226 |
Messages: | 5,345,655 |
Posted today: | 1 |