Skip to content

Instantly share code, notes, and snippets.

@narqo
Created June 3, 2016 23:25
Show Gist options
  • Save narqo/3109465f3003374c92776c64cf141f76 to your computer and use it in GitHub Desktop.
Save narqo/3109465f3003374c92776c64cf141f76 to your computer and use it in GitHub Desktop.
how docker's libnetwork works
docker start ...
docker/daemon/container_linux.go
container.Start()
container.initializeNetworking()
container.AllocateNetwork()
n := container.daemon.netController.NetworkByName()
ep := n.CreateEndpoint()
d := n.driver
d.CreateEndpoint()
ep.AddInterface()
ep.iFaces := append(.., iface)
ep.Join()
sb := ctrlr.sandboxAdd()
for _, iface := range ep.iFaces
sb.AddInterface(iface)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment