issue #98 requires connecting to localhost (which `hostname` may resolve to) will not work.
| ... | ... |
@@ -183,7 +183,9 @@ JOB=$(docker run -d -p 4444 base /bin/nc -l -p 4444) |
| 183 | 183 |
PORT=$(docker port $JOB 4444) |
| 184 | 184 |
|
| 185 | 185 |
# Connect to the public port via the host's public address |
| 186 |
-echo hello world | nc $(hostname) $PORT |
|
| 186 |
+# Please note that because of how routing works connecting to localhost or 127.0.0.1 $PORT will not work. |
|
| 187 |
+IP=$(ifconfig eth0 | perl -n -e 'if (m/inet addr:([\d\.]+)/g) { print $1 }')
|
|
| 188 |
+echo hello world | nc $IP $PORT |
|
| 187 | 189 |
|
| 188 | 190 |
# Verify that the network connection worked |
| 189 | 191 |
echo "Daemon received: $(docker logs $JOB)" |