+ 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: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 54:22:56 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,563 |