Moved updater into server
While we're only reacting to containers going away, it's more convenient to bundle the docker events watcher into the server. I've added a flag to switch it on; and switched it on by default in the container. I also implemented `Zone.DeleteRecordsFor(ident)`, which removes all records for a particular container. One minor change to the structure of the code is that the Zone is now constructed *outside* the server, and given to it and the updater.
This commit is contained in:
1 parent
0fb4bce24d
commit
0749460652
9 files changed
+102
-72
No files matched your search
+1
-1
@@ -2,4 +2,4 @@ FROM scratch
|
||||
# EXPOSE 53/udp
|
||||
WORKDIR /home/weave
|
||||
ADD ./weavedns /home/weave/
|
||||
ENTRYPOINT ["/home/weave/weavedns", "-wait", "5", "-iface", "ethwe"]
|
||||
ENTRYPOINT ["/home/weave/weavedns", "-wait", "5", "-iface", "ethwe", "--watch", "--api", "unix:///var/run/docker.sock"]
|
||||
+4
-13
@@ -1,28 +1,19 @@
|
||||
.DEFAULT: all
|
||||
|
||||
all: server-image updater-image
|
||||
all: server-image
|
||||
|
||||
weavedns: ../server/*.go ../main.go
|
||||
go get -tags netgo ../ && go build -tags netgo -ldflags '-linkmode external -extldflags "-static"' -o $@ -v ../
|
||||
|
||||
updater: ../updater/main.go
|
||||
go get -tags netgo ../updater/ && go build -tags netgo -ldflags '-linkmode external -extldflags "-static"' -o $@ -v ../updater/
|
||||
.PHONY: server-image
|
||||
|
||||
.PHONY: server-image updater-image
|
||||
|
||||
updater-image: /var/tmp/updater.tar
|
||||
server-image: /var/tmp/weavedns.tar
|
||||
|
||||
/var/tmp/weavedns.tar: Dockerfile weavedns
|
||||
sudo -E docker build -t zettio/weavedns .
|
||||
sudo -E docker save zettio/weavedns > $@
|
||||
|
||||
/var/tmp/updater.tar: ../updater/Dockerfile updater
|
||||
sudo -E docker build -t zettio/updater ../updater/
|
||||
sudo -E docker save zettio/updater > $@
|
||||
|
||||
clean:
|
||||
-sudo docker rmi zettio/weavedns
|
||||
-sudo docker rmi zettio/updater
|
||||
rm -f weavedns updater
|
||||
rm -f /var/tmp/{updater,weavedns}.tar
|
||||
rm -f weavedns
|
||||
rm -f /var/tmp/weavedns.tar
|
||||
Reference in new issue
Block a user