+ cat docker-compose.yml
services:
-a-a-a web:
-a-a-a-a-a-a-a image: php:apache
-a-a-a-a-a-a-a extra_hosts:
-a-a-a-a-a-a-a-a-a-a-a - "host1:192.168.1.15"
-a-a-a-a-a-a-a-a-a-a-a - "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: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 00:44:11 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
10 files (20,373K bytes) |
| Messages: | 264,053 |