diff --git a/site/features.md b/site/features.md
index baa580a4..4dbbb7ab 100644
--- a/site/features.md
+++ b/site/features.md
@@ -11,6 +11,7 @@ example](https://github.com/weaveworks/weave#example):
* [Virtual ethernet switch](#virtual-ethernet-switch)
* [Fast data path](#fast-data-path)
* [Seamless Docker integration](#docker)
+ * [Docker network plugin](#plugin)
* [Address allocation](#addressing)
* [Naming and discovery](#naming-and-discovery)
* [Application isolation](#application-isolation)
@@ -88,6 +89,24 @@ Containers started in this way that subsequently restart, either by an
explicit `docker restart` command or by Docker restart policy, are
re-attached to the weave network by the weave Docker API proxy.
+### Docker network plugin
+
+Alternatively, you can use weave as a Docker plugin. First you must
+configure the Docker daemon to use a cluster store as documented
+[here](https://docs.docker.com/engine/userguide/networking/dockernetworks/#an-overlay-network);
+you can then launch weave and create a network:
+
+ $ weave launch
+ $ weave launch-plugin
+ $ docker network create --driver=weave weave
+
+and then start a container:
+
+ $ docker run --net=weave -ti ubuntu
+
+For more details see the
+[plugin README](https://github.com/weaveworks/docker-plugin).
+
### Address allocation
Containers are automatically allocated an IP address that is unique
diff --git a/weave b/weave
index 855319f1..248d9df5 100755
--- a/weave
+++ b/weave
@@ -58,6 +58,7 @@ weave launch-proxy [-H ] [--with-dns | --without-dns]
[--hostname-match ]
[--hostname-replacement ]
[--rewrite-inspect]
+weave launch-plugin
weave env [--restore]
weave config
weave connect [--replace] [ ...]
@@ -80,6 +81,7 @@ weave ps [ ...]
weave stop
weave stop-router
weave stop-proxy
+weave stop-plugin
weave reset
weave rmpeer
@@ -288,6 +290,10 @@ fi
BASE_IMAGE=$DOCKERHUB_USER/weave
IMAGE=$BASE_IMAGE:$IMAGE_VERSION
+BASE_PLUGIN_IMAGE=$DOCKERHUB_USER/plugin
+PLUGIN_IMAGE=$BASE_PLUGIN_IMAGE:$IMAGE_VERSION
+PLUGIN_CONTAINER_NAME=weaveplugin
+
PROCFS=${PROCFS:-/proc}
DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0}
CONTAINER_NAME=${WEAVE_CONTAINER_NAME:-weave}
@@ -1549,6 +1555,19 @@ stop_proxy() {
stop $PROXY_CONTAINER_NAME "Proxy"
}
+launch_plugin() {
+ PLUGIN_CONTAINER=$(docker run --privileged -d --name=$PLUGIN_CONTAINER_NAME \
+ --restart=always \
+ --net=host \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ -v /run/docker/plugins:/run/docker/plugins \
+ $PLUGIN_IMAGE "$@")
+}
+
+stop_plugin() {
+ stop $PLUGIN_CONTAINER_NAME "Plugin"
+}
+
##########################################################################################
[ $(id -u) = 0 ] || {
@@ -1647,7 +1666,7 @@ shift 1
case "$COMMAND" in
setup)
- for img in $IMAGE $EXEC_IMAGE ; do
+ for img in $IMAGE $EXEC_IMAGE $PLUGIN_IMAGE ; do
docker pull $img
done
;;
@@ -1699,6 +1718,11 @@ EOF
launch_proxy "$@"
echo $PROXY_CONTAINER
;;
+ launch-plugin)
+ check_not_running $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE
+ launch_plugin "$@"
+ echo $PLUGIN_CONTAINER
+ ;;
env|proxy-env)
[ "$COMMAND" = "env" ] || deprecation_warning "$COMMAND" "'weave env'"
if PROXY_ADDR=$(proxy_addr) ; then
@@ -1754,6 +1778,11 @@ EOF
echo " Service: proxy"
echo " Address: $PROXY_ADDRS"
fi
+ if [ -z "$SUB_STATUS" ] && check_running $PLUGIN_CONTAINER_NAME 2>/dev/null ; then
+ echo
+ echo " Service: plugin"
+ echo " DriverName: weave"
+ fi
[ -n "$SUB_STATUS" ] || echo
[ $res -eq 0 ]
;;
@@ -1940,6 +1969,10 @@ EOF
[ $# -eq 0 ] || usage
stop_proxy
;;
+ stop-plugin)
+ [ $# -eq 0 ] || usage
+ stop_plugin
+ ;;
reset)
[ $# -eq 0 ] || usage
warn_if_stopping_proxy_in_env