Skip to content

Commit

Permalink
Merge pull request #1935 from /issues/1757-volumes-container
Browse files Browse the repository at this point in the history
Reduce docker volumes for weavewait to just one set per release

Fixes #1757.
  • Loading branch information
rade committed Jan 29, 2016
2 parents eae45eb + ea50b3d commit c6f356a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 0 additions & 3 deletions prog/weaveexec/Dockerfile
Expand Up @@ -4,9 +4,6 @@ MAINTAINER Weaveworks Inc <help@weave.works>
LABEL works.weave.role=system

WORKDIR /home/weave
VOLUME /w
VOLUME /w-noop
VOLUME /w-nomcast
ENTRYPOINT ["/home/weave/sigproxy", "/home/weave/weave"]

RUN apk add --update \
Expand Down
2 changes: 1 addition & 1 deletion test/config.sh
Expand Up @@ -176,7 +176,7 @@ proxy_start_container_with_dns() {
rm_containers() {
host=$1
shift
[ $# -eq 0 ] || docker_on $host rm -f "$@" >/dev/null
[ $# -eq 0 ] || docker_on $host rm -f -v "$@" >/dev/null
}

container_ip() {
Expand Down
9 changes: 9 additions & 0 deletions weave
Expand Up @@ -344,6 +344,7 @@ IMAGE=$BASE_IMAGE:$IMAGE_VERSION
BASE_PLUGIN_IMAGE=$DOCKERHUB_USER/plugin
PLUGIN_IMAGE=$BASE_PLUGIN_IMAGE:$IMAGE_VERSION
PLUGIN_CONTAINER_NAME=weaveplugin
VOLUMES_CONTAINER_NAME=weavevolumes-$IMAGE_VERSION

PROCFS=${PROCFS:-/proc}
DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0}
Expand Down Expand Up @@ -1686,8 +1687,14 @@ launch_proxy() {
docker_client_args $DOCKER_CLIENT_ARGS
proxy_args "$@"
mkdir -p /var/run/weave
# Create a data-only container to mount the weavewait files from
if ! docker inspect -f ' ' $VOLUMES_CONTAINER_NAME > /dev/null 2>&1 ; then
docker create -v /w -v /w-noop -v /w-nomcast --name=$VOLUMES_CONTAINER_NAME \
--label=weavevolumes --entrypoint=/bin/false $EXEC_IMAGE >/dev/null
fi
PROXY_CONTAINER=$(docker run --privileged -d --name=$PROXY_CONTAINER_NAME --net=host \
$PROXY_VOLUMES \
--volumes-from $VOLUMES_CONTAINER_NAME \
$(docker_sock_options) \
-v /var/run/weave:/var/run/weave \
-v /proc:/hostproc \
Expand Down Expand Up @@ -2180,6 +2187,8 @@ EOF
docker stop $NAME >/dev/null 2>&1 || true
docker rm -f $NAME >/dev/null 2>&1 || true
done
VOLUME_CONTAINERS=$(docker ps -qa --filter label=weavevolumes)
[ -n "$VOLUME_CONTAINERS" ] && docker rm -v $VOLUME_CONTAINERS >/dev/null 2>&1 || true
conntrack -D -p udp --dport $PORT >/dev/null 2>&1 || true
destroy_bridge
for LOCAL_IFNAME in $(ip link show | grep v${CONTAINER_IFNAME}pl | cut -d ' ' -f 2 | tr -d ':') ; do
Expand Down

0 comments on commit c6f356a

Please sign in to comment.