Add plugin code

This adds basic plugins.
"main" types: veth, bridge, macvlan
"ipam" type: host-local

The code has been ported over from github.com/coreos/rkt project
and adapted to fit the CNI spec.
This commit is contained in:
Eugene Yakubovich
2015-04-15 15:35:02 -07:00
parent 502be19aed
commit 88377fa346
74 changed files with 8792 additions and 0 deletions

21
scripts/docker-run.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# Run a docker container with network namespace set up by the
# CNI plugins.
# Example usage: ./docker-run.sh --rm busybox /sbin/ifconfig
contid=$(docker run -d --net=none busybox:latest /bin/sleep 10000000)
pid=$(docker inspect -f '{{ .State.Pid }}' $contid)
netnspath=/proc/$pid/ns/net
./exec-plugins.sh add $netnspath
function cleanup() {
./exec-plugins.sh del $netnspath
docker kill $contid >/dev/null
}
trap cleanup EXIT
docker run --net=container:$contid $@