Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. # Network docker containers tricks
  2.  
  3. If you host Docker on a Virtual Machine (a Vagrant managed VM for instance, or the common boot2Docker you have in MAC OSx or Windows systems), you can make docker containers reachable from your VM's host by routing request to the virtual machine that's running docker.
  4.  
  5. NOTE: you should have your virtual machine configured as `bridged network`.
  6.  
  7. Linux
  8.  
  9. > ip route [add|replace] <INTERNAL_IP_DOCKER> via <BRIDGE_DOCKER_VM_IP> dev <INTERFACE>
  10.  
  11. > sudo ip route add 172.17.0.0/24 via <dockers vm IP> dev eth1
  12.  
  13. MacOSx
  14.  
  15. > route [add|change] -net -ifscope <INTERFACE> <DOCKER_IP_IN_VM_MASK> <BRIDGE_DOCKER_VM_IP>
  16.  
  17. > sudo route add -net -ifscope en1 172.17.0.0/24 <dockers vm IP>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement