[2015/8/19] Docker Meetup Tokyo #5
Yu Yamanaka (@yuurelx)
DevOps engineer at peroli, Inc.
PV = 250 million
UU = 19 millon
Web Media + Native Apps + Ad Platform + ??
Because it makes
easier to lay out network and faster than default mode
Subtopics
(From: "http://www.agilegroup.co.jp/technote/docker-network-in-bridge.html")
Using host machine's network stack!
$ HOST_IP=`ip addr show eth0 | grep -oE 'inet [^/]+' | cut -d ' ' -f 2`
$ docker run -d -E DB_HOST=$HOST_IP awesome_app:latest
config/database.yml
------------------------------
production:
host: <%= ENV['DB_HOST'] %>
username: user
password: secret
...
------------------------------
etc...
$ docker run -d --net=host awesome_app:latest
config/database.yml
------------------------------
production:
host: 127.0.0.1
username: user
password: secret
...
------------------------------
etc...
127.0.0.1
"Great idea, but not so good in reality"
Apache Bench
container
100%
110%
About 10% slower...
1000 reqs
(by 65 sessions)
DB
Apache Bench
container
100%
100%
No overhead!
DB
FASTER IS BETTER
Host net. mode makes
easier to lay out network and faster than default mode
But it sacrifices Docker's portability and independence. (e.g. port collision)
You should use this with caution!
Yu Yamanaka (@yuurelx)
DevOps engineer at peroli, Inc.