# ip link show 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group d link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Us # iptables -L -n -v Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source de ɹ Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source de ɹ Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source de 32
ϖΞͷ࡞ # ip link add name veth0-host type veth peer name veth0-ct # ip link show ▶ ยํͷ veth Λผͷ໊લۭؒ # ip link set veth0-ct netns netns01 # ip link show | grep veth0 4: veth0-host: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfif # ip netns exec netns01 ip link show 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 3: veth0-ct: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen link/ether be:82:25:d8:94:30 brd ff:ff:ff:ff:ff:ff 33
ͷઃఆ ip link set up vethtest01-host ip addr add 10.10.10.10/24 dev veth0-host ▶ ผͷ໊લۭؒଆͷ veth ͷઃఆ # ip netns exec netns01 ip addr add 10.10.10.11/24 dev veth0-ct # ip netns exec netns01 ip link set veth0-ct up # ip netns exec netns01 ip addr show 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 3: veth0-ct: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fa link/ether be:82:25:d8:94:30 brd ff:ff:ff:ff:ff:ff inet 10.10.10.11/24 scope global veth0-ct valid_lft forever preferred_lft forever inet6 fe80::bc82:25ff:fed8:9430/64 scope link valid_lft forever preferred_lft forever ▶ ping ࣮ߦ 34
▶ ඪ४తͳΧʔωϧͷ API ͔Β͔ͳΓҳ͍ͯ͠Δ ▶ ϑΝΠϧγεςϜ͔ͩΒΞΫηεݖ͑͋͞Ε୭ͰΧʔω ϧΛ੍ޚͰ͖Δ ▶ αϒγεςϜຖʹগͣͭ͠ಈ͖͕ҧͬͨΓ ▶ ৭ʑͳॴʹϚϯτͰ͖ͨΓ ▶ ෳࡶͳׂʹॊೈͳઃఆͰ͖ͳ͍ ▶ (ࢀߟ) Linux Χʔωϧͷͯ͢: cgroup ͷ࠶ઃܭ (ݪจ) ▶ (ࢀߟ) Changes coming for systemd and control groups 38
͕࡞ΒΕΔ # lxc-config lxc.lxcpath /var/lib/lxc # ls /var/lib/lxc ubuntu01 # ls /var/lib/lxc/ubuntu01 config rootfs # ls /var/lib/lxc/ubuntu01/rootfs/ bin dev home lib64 mnt proc run srv tmp var boot etc lib media opt root sbin sys usr ▶ ίϯςφͷϑΝΠϧγεςϜී௨ʹϗετ্ͷσΟϨΫτ ϦπϦʔͱͯ͠ߏங͞ΕΔ 45
Mac Ͱಈͣ͋͘Γ·ͤΜ :-) ▶ ͕ɺVirtualBox ܦ༝Ͱ Docker Λ͑·͢ ▶ Πϯετʔϥ͋Γ؆୯!! ˠ Installing Docker on Mac OS X ▶ Πϯετʔϥ ˠ https: //github.com/boot2docker/osx-installer/releases 74
1.1.1 Client API version: 1.13 Go version (client): go1.2.1 Git commit (client): bd609d2 Server version: 1.1.1 Server API version: 1.13 Go version (server): go1.2.1 Git commit (server): bd609d2 $ docker info Containers: 0 Images: 0 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Dirs: 0 Execution Driver: native-0.2 Kernel Version: 3.13.0-30-generic WARNING: No swap limit support 75
$ brctl show bridge name bridge id STP enabled interfaces docker0 8000.56847afe9799 no ▶ ίϯςφىಈޙ $ brctl show bridge name bridge id STP enabled interfaces docker0 8000.56847afe9799 no vethcf5a ▶ veth ΠϯλʔϑΣʔε͕࡞ΒΕɺdocker0 ʹΞλον͞Εͯ ͍Δ͜ͱ͕Θ͔Δɻ 88