Files
weave/weaver/Makefile
T
David Wragg 89fa310c00 Provide a way to bypass the use of sudo
It's not necessary to be root to run "docker" commands, if your
user is in the "docker" group.
2014-10-06 19:34:12 +01:00

27 lines
649 B
Makefile

.DEFAULT: all
# If you can use docker with being root, you can do "make SUDO="
SUDO=sudo
all: docker-image
weaver: ../*.go main.go
go get
go build -ldflags '-extldflags "-static"'
.PHONY: docker-image
docker-image: /tmp/weave.tar
/tmp/weave.tar: Dockerfile weaver
$(SUDO) docker build -t zettio/weave .
$(SUDO) docker save zettio/weave > /tmp/weave.tar
publish: docker-image
$(SUDO) docker tag zettio/weave zettio/weave:git-`git rev-parse --short=12 HEAD`
$(SUDO) docker push zettio/weave:latest
$(SUDO) docker push zettio/weave:git-`git rev-parse --short=12 HEAD`
clean:
-$(SUDO) docker rmi zettio/weave
rm -f weaver /tmp/weave.tar