Created
October 9, 2016 03:00
-
-
Save mavenugo/3aa8640915435b1850fbd2707fbf58e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
madhu@Madhus-MBP ~ $ docker network create --subnet=40.1.1.0/24 my-user-net | |
68f40c6cd46aae2fd5388b03020e75741ebba6eeca04251068a2b9d509df2e9f | |
madhu@Madhus-MBP ~ $ docker run --name=my-svc1 --ip=40.1.1.2 --net=my-user-net -itd busybox sh | |
072b141a23caf54af5e6091a8eda847787e61eb209d207246d1c7c7bebf4096c | |
madhu@Madhus-MBP ~ $ docker run --name=my-svc2 --ip=40.1.1.3 --link=my-svc1:mysvc --net=my-user-net -itd busybox sh | |
84093ed474d985091698db550d9b503c8ac65c7742c7056951e0c21deba3c66c | |
madhu@Madhus-MBP ~ $ docker exec -it my-svc2 sh | |
/ # ping mysvc | |
PING mysvc (40.1.1.2): 56 data bytes | |
64 bytes from 40.1.1.2: seq=0 ttl=64 time=0.114 ms | |
64 bytes from 40.1.1.2: seq=1 ttl=64 time=0.093 ms | |
64 bytes from 40.1.1.2: seq=2 ttl=64 time=0.094 ms | |
^C | |
--- mysvc ping statistics --- | |
3 packets transmitted, 3 packets received, 0% packet loss | |
round-trip min/avg/max = 0.093/0.100/0.114 ms | |
/ # madhu@Madhus-MBP ~ $ | |
madhu@Madhus-MBP ~ $ docker version | |
Client: | |
Version: 1.12.2-rc1 | |
API version: 1.24 | |
Go version: go1.6.3 | |
Git commit: 45bed2c | |
Built: Tue Sep 27 23:38:15 2016 | |
OS/Arch: darwin/amd64 | |
Experimental: true | |
Server: | |
Version: 1.12.2-rc1 | |
API version: 1.24 | |
Go version: go1.6.3 | |
Git commit: 45bed2c | |
Built: Tue Sep 27 23:38:15 2016 | |
OS/Arch: linux/amd64 | |
Experimental: true | |
madhu@Madhus-MBP ~ $ docker run --name=my-svc3 -p 8080:8080 --ip=40.1.1.4 --net=my-user-net -itd busybox sh | |
08006506ef952426d3a7944ecb45400c636d8b3119db73187c5e9cf94e4d705a | |
madhu@Madhus-MBP ~ $ docker exec -it my-svc3 sh | |
/ # nc -l -p 8080 | |
hi | |
madhu@Madhus-MBP ~ $ nc localhost 8080 | |
hi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment