diff --git a/.gitignore b/.gitignore index 3da087b3..47c9056e 100644 --- a/.gitignore +++ b/.gitignore @@ -53,14 +53,14 @@ testing/runner/runner releases .*.uptodate weave*.tar.gz -prog/weaveexec/weave +prog/weaver/weave prog/weaveexec/weavehosts prog/weaveexec/weaveproxy prog/weaveexec/weavewait prog/weaveexec/weavewait_noop prog/weaveexec/weavewait_nomcast prog/weaveexec/sigproxy -prog/weaveexec/weaveutil +prog/weaver/weaveutil prog/weaveexec/docker* Vagrantfile.local test/tls/tls diff --git a/Makefile b/Makefile index 80af0660..cab30071 100644 --- a/Makefile +++ b/Makefile @@ -250,17 +250,17 @@ else endif # The targets below builds the weave images -$(WEAVER_UPTODATE): prog/weaver/Dockerfile.$(DOCKERHUB_USER) $(WEAVER_EXE) $(WEAVEEXEC_UPTODATE) +$(WEAVER_UPTODATE): prog/weaver/Dockerfile.$(DOCKERHUB_USER) $(WEAVER_EXE) weave $(WEAVEUTIL_EXE) + cp $(WEAVEUTIL_EXE) prog/weaver/weaveutil + cp weave prog/weaver/weave $(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker build -f prog/weaver/Dockerfile.$(DOCKERHUB_USER) -t $(WEAVER_IMAGE) prog/weaver touch $@ -$(WEAVEEXEC_UPTODATE): prog/weaveexec/Dockerfile.$(DOCKERHUB_USER) prog/weaveexec/symlink $(DOCKER_DISTRIB) weave $(SIGPROXY_EXE) $(WEAVEWAIT_EXE) $(WEAVEWAIT_NOOP_EXE) $(WEAVEWAIT_NOMCAST_EXE) $(WEAVEUTIL_EXE) - cp weave prog/weaveexec/weave +$(WEAVEEXEC_UPTODATE): prog/weaveexec/Dockerfile.$(DOCKERHUB_USER) prog/weaveexec/symlink $(DOCKER_DISTRIB) $(SIGPROXY_EXE) $(WEAVEWAIT_EXE) $(WEAVEWAIT_NOOP_EXE) $(WEAVEWAIT_NOMCAST_EXE) $(WEAVER_UPTODATE) cp $(SIGPROXY_EXE) prog/weaveexec/sigproxy cp $(WEAVEWAIT_EXE) prog/weaveexec/weavewait cp $(WEAVEWAIT_NOOP_EXE) prog/weaveexec/weavewait_noop cp $(WEAVEWAIT_NOMCAST_EXE) prog/weaveexec/weavewait_nomcast - cp $(WEAVEUTIL_EXE) prog/weaveexec/weaveutil tar -xf $(DOCKER_DISTRIB) usr/local/bin/docker -O > prog/weaveexec/docker chmod +x prog/weaveexec/docker $(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker build -f prog/weaveexec/Dockerfile.$(DOCKERHUB_USER) -t $(WEAVEEXEC_IMAGE) prog/weaveexec diff --git a/prog/weaveexec/Dockerfile.template b/prog/weaveexec/Dockerfile.template index 716dda01..1f9e8bd6 100644 --- a/prog/weaveexec/Dockerfile.template +++ b/prog/weaveexec/Dockerfile.template @@ -1,32 +1,9 @@ -FROM ALPINE_BASEIMAGE - -# If we're building for another architecture than amd64, the CROSS_BUILD_ placeholder is removed so e.g. CROSS_BUILD_COPY turns into COPY -# If we're building normally, for amd64, CROSS_BUILD lines are removed -CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ - -LABEL maintainer "Weaveworks Inc " -LABEL works.weave.role=system \ - org.label-schema.name="Weave Net" \ - org.label-schema.description="Weave Net creates a virtual network that connects Docker containers across multiple hosts and enables their automatic discovery" \ - org.label-schema.url="https://weave.works" \ - org.label-schema.vcs-url="https://github.com/weaveworks/weave" \ - org.label-schema.vendor="Weaveworks" +FROM DOCKERHUB_USER/weaveARCH_EXT ENTRYPOINT ["/home/weave/sigproxy", "/home/weave/weave"] -RUN apk add --update \ - curl \ - ethtool \ - iptables \ - ipset \ - iproute2 \ - util-linux \ - conntrack-tools \ - bind-tools \ - && rm -rf /var/cache/apk/* - -ADD ./weave ./sigproxy ./symlink /home/weave/ -ADD ./weaveutil ./docker /usr/bin/ +ADD ./sigproxy ./symlink /home/weave/ +ADD ./docker /usr/bin/ ADD ./weavewait /w/w ADD ./weavewait_noop /w-noop/w ADD ./weavewait_nomcast /w-nomcast/w diff --git a/prog/weaver/Dockerfile.template b/prog/weaver/Dockerfile.template index 78b95c36..6be43c42 100644 --- a/prog/weaver/Dockerfile.template +++ b/prog/weaver/Dockerfile.template @@ -1,5 +1,31 @@ -FROM DOCKERHUB_USER/weaveexecARCH_EXT -ADD ./weaver /home/weave/ +FROM ALPINE_BASEIMAGE + +# If we're building for another architecture than amd64, the CROSS_BUILD_ placeholder is removed so e.g. CROSS_BUILD_COPY turns into COPY +# If we're building normally, for amd64, CROSS_BUILD lines are removed +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ + +LABEL maintainer "Weaveworks Inc " +LABEL works.weave.role=system \ + org.label-schema.name="Weave Net" \ + org.label-schema.description="Weave Net creates a virtual network that connects Docker containers across multiple hosts and enables their automatic discovery" \ + org.label-schema.url="https://weave.works" \ + org.label-schema.vcs-url="https://github.com/weaveworks/weave" \ + org.label-schema.vendor="Weaveworks" + +RUN apk add --update \ + curl \ + ethtool \ + iptables \ + ipset \ + iproute2 \ + util-linux \ + conntrack-tools \ + bind-tools \ + && rm -rf /var/cache/apk/* + +ADD ./weave ./weaver /home/weave/ +ADD ./weaveutil /usr/bin/ ADD weavedata.db /weavedb/ COPY ca-certificates.crt /etc/ssl/certs/ ENTRYPOINT ["/home/weave/weaver"] +WORKDIR /home/weave diff --git a/weave b/weave index 6bdc4459..4034599d 100755 --- a/weave +++ b/weave @@ -218,8 +218,6 @@ kill_container() { # main ###################################################################### -check_docker_version - [ "$1" = "--local" ] && shift 1 && IS_LOCAL=1 # "--help|help" are special because we always want to process them @@ -244,6 +242,7 @@ elif [ "$1" = "env" -a "$2" = "--restore" ] ; then fi if [ -z "$IS_LOCAL" ] ; then + check_docker_version exec_remote "$@" exit $? fi