Merge weaveworks/separate_image_build_and_export (PR #994)
separate the image build and export phases
This commit is contained in:
commit
12c17d39cc
5 files changed
+29
-25
No files matched your search
+3
-2
@@ -39,9 +39,10 @@ prog/netcheck/netcheck
|
|||||||
tools/bin
|
tools/bin
|
||||||
tools/build
|
tools/build
|
||||||
releases
|
releases
|
||||||
|
.weaver.uptodate
|
||||||
|
.weavedns.uptodate
|
||||||
|
.weaveexec.uptodate
|
||||||
weave.tar
|
weave.tar
|
||||||
weavedns.tar
|
|
||||||
weaveexec.tar
|
|
||||||
prog/weaveexec/weave
|
prog/weaveexec/weave
|
||||||
prog/weaveexec/weaveproxy
|
prog/weaveexec/weaveproxy
|
||||||
prog/weaveexec/weavewait
|
prog/weaveexec/weavewait
|
||||||
|
|||||||
@@ -18,23 +18,25 @@ NETCHECK_EXE=prog/netcheck/netcheck
|
|||||||
|
|
||||||
EXES=$(WEAVER_EXE) $(WEAVEDNS_EXE) $(SIGPROXY_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(NETCHECK_EXE)
|
EXES=$(WEAVER_EXE) $(WEAVEDNS_EXE) $(SIGPROXY_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(NETCHECK_EXE)
|
||||||
|
|
||||||
|
WEAVER_UPTODATE=.weaver.uptodate
|
||||||
|
WEAVEDNS_UPTODATE=.weavedns.uptodate
|
||||||
|
WEAVEEXEC_UPTODATE=.weaveexec.uptodate
|
||||||
|
|
||||||
|
IMAGES_UPTODATE=$(WEAVER_UPTODATE) $(WEAVEDNS_UPTODATE) $(WEAVEEXEC_UPTODATE)
|
||||||
|
|
||||||
WEAVER_IMAGE=$(DOCKERHUB_USER)/weave
|
WEAVER_IMAGE=$(DOCKERHUB_USER)/weave
|
||||||
WEAVEDNS_IMAGE=$(DOCKERHUB_USER)/weavedns
|
WEAVEDNS_IMAGE=$(DOCKERHUB_USER)/weavedns
|
||||||
WEAVEEXEC_IMAGE=$(DOCKERHUB_USER)/weaveexec
|
WEAVEEXEC_IMAGE=$(DOCKERHUB_USER)/weaveexec
|
||||||
|
|
||||||
IMAGES=$(WEAVER_IMAGE) $(WEAVEDNS_IMAGE) $(WEAVEEXEC_IMAGE)
|
IMAGES=$(WEAVER_IMAGE) $(WEAVEDNS_IMAGE) $(WEAVEEXEC_IMAGE)
|
||||||
|
|
||||||
WEAVER_EXPORT=weave.tar
|
WEAVE_EXPORT=weave.tar
|
||||||
WEAVEDNS_EXPORT=weavedns.tar
|
|
||||||
WEAVEEXEC_EXPORT=weaveexec.tar
|
|
||||||
|
|
||||||
EXPORTS=$(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVEEXEC_EXPORT)
|
|
||||||
|
|
||||||
WEAVEEXEC_DOCKER_VERSION=1.3.1
|
WEAVEEXEC_DOCKER_VERSION=1.3.1
|
||||||
DOCKER_DISTRIB=prog/weaveexec/docker-$(WEAVEEXEC_DOCKER_VERSION).tgz
|
DOCKER_DISTRIB=prog/weaveexec/docker-$(WEAVEEXEC_DOCKER_VERSION).tgz
|
||||||
DOCKER_DISTRIB_URL=https://get.docker.com/builds/Linux/x86_64/docker-$(WEAVEEXEC_DOCKER_VERSION).tgz
|
DOCKER_DISTRIB_URL=https://get.docker.com/builds/Linux/x86_64/docker-$(WEAVEEXEC_DOCKER_VERSION).tgz
|
||||||
|
|
||||||
all: $(EXPORTS)
|
all: $(WEAVE_EXPORT)
|
||||||
|
|
||||||
travis: $(EXES)
|
travis: $(EXES)
|
||||||
|
|
||||||
@@ -66,15 +68,15 @@ $(SIGPROXY_EXE): prog/sigproxy/main.go
|
|||||||
$(WEAVEWAIT_EXE): prog/weavewait/main.go
|
$(WEAVEWAIT_EXE): prog/weavewait/main.go
|
||||||
go build -o $@ ./$(@D)
|
go build -o $@ ./$(@D)
|
||||||
|
|
||||||
$(WEAVER_EXPORT): prog/weaver/Dockerfile $(WEAVER_EXE)
|
$(WEAVER_UPTODATE): prog/weaver/Dockerfile $(WEAVER_EXE)
|
||||||
$(SUDO) docker build -t $(WEAVER_IMAGE) prog/weaver
|
$(SUDO) docker build -t $(WEAVER_IMAGE) prog/weaver
|
||||||
$(SUDO) docker save $(WEAVER_IMAGE):latest > $@
|
touch $@
|
||||||
|
|
||||||
$(WEAVEDNS_EXPORT): prog/weavedns/Dockerfile $(WEAVEDNS_EXE)
|
$(WEAVEDNS_UPTODATE): prog/weavedns/Dockerfile $(WEAVEDNS_EXE)
|
||||||
$(SUDO) docker build -t $(WEAVEDNS_IMAGE) prog/weavedns
|
$(SUDO) docker build -t $(WEAVEDNS_IMAGE) prog/weavedns
|
||||||
$(SUDO) docker save $(WEAVEDNS_IMAGE):latest > $@
|
touch $@
|
||||||
|
|
||||||
$(WEAVEEXEC_EXPORT): prog/weaveexec/Dockerfile $(DOCKER_DISTRIB) weave $(SIGPROXY_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(NETCHECK_EXE)
|
$(WEAVEEXEC_UPTODATE): prog/weaveexec/Dockerfile $(DOCKER_DISTRIB) weave $(SIGPROXY_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(NETCHECK_EXE)
|
||||||
cp weave prog/weaveexec/weave
|
cp weave prog/weaveexec/weave
|
||||||
cp $(SIGPROXY_EXE) prog/weaveexec/sigproxy
|
cp $(SIGPROXY_EXE) prog/weaveexec/sigproxy
|
||||||
cp $(WEAVEPROXY_EXE) prog/weaveexec/weaveproxy
|
cp $(WEAVEPROXY_EXE) prog/weaveexec/weaveproxy
|
||||||
@@ -82,7 +84,10 @@ $(WEAVEEXEC_EXPORT): prog/weaveexec/Dockerfile $(DOCKER_DISTRIB) weave $(SIGPROX
|
|||||||
cp $(NETCHECK_EXE) prog/weaveexec/netcheck
|
cp $(NETCHECK_EXE) prog/weaveexec/netcheck
|
||||||
cp $(DOCKER_DISTRIB) prog/weaveexec/docker.tgz
|
cp $(DOCKER_DISTRIB) prog/weaveexec/docker.tgz
|
||||||
$(SUDO) docker build -t $(WEAVEEXEC_IMAGE) prog/weaveexec
|
$(SUDO) docker build -t $(WEAVEEXEC_IMAGE) prog/weaveexec
|
||||||
$(SUDO) docker save $(WEAVEEXEC_IMAGE):latest > $@
|
touch $@
|
||||||
|
|
||||||
|
$(WEAVE_EXPORT): $(IMAGES_UPTODATE)
|
||||||
|
$(SUDO) docker save $(addsuffix :latest,$(IMAGES)) > $@
|
||||||
|
|
||||||
$(DOCKER_DISTRIB):
|
$(DOCKER_DISTRIB):
|
||||||
curl -o $(DOCKER_DISTRIB) $(DOCKER_DISTRIB_URL)
|
curl -o $(DOCKER_DISTRIB) $(DOCKER_DISTRIB_URL)
|
||||||
@@ -112,7 +117,7 @@ publish: $(PUBLISH)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(SUDO) docker rmi $(IMAGES)
|
-$(SUDO) docker rmi $(IMAGES)
|
||||||
rm -f $(EXES) $(EXPORTS)
|
rm -f $(EXES) $(IMAGES_UPTODATE) $(WEAVE_EXPORT)
|
||||||
rm -f test/tls/*.pem
|
rm -f test/tls/*.pem
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|||||||
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
|
|
||||||
RUN apt-get -y update && apt-get -y install --no-install-recommends build-essential git ca-certificates docker.io mercurial libpcap-dev curl make pkg-config gcc bison flex
|
RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates apt-transport-https
|
||||||
|
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
|
||||||
|
RUN echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
|
||||||
|
RUN apt-get -y update && apt-get -y install --no-install-recommends build-essential git lxc-docker-1.3.1 mercurial libpcap-dev curl make pkg-config gcc bison flex
|
||||||
|
|
||||||
# When doing a build in a container, "apt-get update" happens twice,
|
# When doing a build in a container, "apt-get update" happens twice,
|
||||||
# which can be a very significant overhead for incremental builds.
|
# which can be a very significant overhead for incremental builds.
|
||||||
|
|||||||
+4
-7
@@ -57,8 +57,7 @@ $ make
|
|||||||
|
|
||||||
This will build the weave components and package them into three
|
This will build the weave components and package them into three
|
||||||
Docker images (`weaveworks/weave`, `weaveworks/weavedns`, and
|
Docker images (`weaveworks/weave`, `weaveworks/weavedns`, and
|
||||||
`weaveworks/weaveexec`). These are then exported (as `weave.tar`,
|
`weaveworks/weaveexec`). These are then exported as `weave.tar`.
|
||||||
`weavedns.tar` and `weaveexec.tar`).
|
|
||||||
|
|
||||||
## Building in a Docker container
|
## Building in a Docker container
|
||||||
|
|
||||||
@@ -171,15 +170,13 @@ you can do so with
|
|||||||
$ vagrant ssh -c 'make -C src/github.com/weaveworks/weave'
|
$ vagrant ssh -c 'make -C src/github.com/weaveworks/weave'
|
||||||
```
|
```
|
||||||
|
|
||||||
you should then find container snapshot tarballs in the top-level
|
you should then find a `weave.tar` container snapshot tarball in the
|
||||||
directory. You can use these snapshots with `docker load` against a
|
top-level directory. You can use that snapshot with `docker load`
|
||||||
different host, e.g.
|
against a different host, e.g.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ export DOCKER_HOST=tcp://<HOST:PORT>
|
$ export DOCKER_HOST=tcp://<HOST:PORT>
|
||||||
$ docker load < weave.tar
|
$ docker load < weave.tar
|
||||||
$ docker load < weavedns.tar
|
|
||||||
$ docker load < weaveexec.tar
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can provide extra Vagrant configuration by putting a file
|
You can provide extra Vagrant configuration by putting a file
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ echo "Copying weave images, scripts, and certificates to hosts, and"
|
|||||||
echo " prefetch test images"
|
echo " prefetch test images"
|
||||||
for HOST in $HOSTS; do
|
for HOST in $HOSTS; do
|
||||||
docker_on $HOST load -i ../weave.tar
|
docker_on $HOST load -i ../weave.tar
|
||||||
docker_on $HOST load -i ../weavedns.tar
|
|
||||||
docker_on $HOST load -i ../weaveexec.tar
|
|
||||||
run_on $HOST mkdir -p bin
|
run_on $HOST mkdir -p bin
|
||||||
cat ../bin/docker-ns | run_on $HOST sh -c "cat > $DOCKER_NS"
|
cat ../bin/docker-ns | run_on $HOST sh -c "cat > $DOCKER_NS"
|
||||||
cat ../weave | run_on $HOST sh -c "cat > ./weave"
|
cat ../weave | run_on $HOST sh -c "cat > ./weave"
|
||||||
|
|||||||
Reference in new issue
Block a user