Files
weave-scope/examples/plugins/traffic-control/Makefile
Alessandro Puccetti 66390c8b0e circleci: push traffic control plugin image to docker hub
After this patch, circleci builds the traffic control plugin image and
pushes it on docker hub. Rename traffic control plugin docker image
to "weaveworks/scope-traffic-control-plugin".
2016-09-12 15:47:28 +02:00

34 lines
935 B
Makefile

.PHONY: run clean
SUDO=$(shell docker info >/dev/null 2>&1 || echo "sudo -E")
EXE=traffic-control
IMAGE=weaveworks/scope-$(EXE)-plugin
NAME=weaveworks-scope-${EXE}-plugin
UPTODATE=.$(EXE).uptodate
run: $(UPTODATE)
# --net=host gives us the remote hostname, in case we're being launched against a non-local docker host.
# We could also pass in the `-hostname=foo` flag, but that doesn't work against a remote docker host.
$(SUDO) docker run --rm -it \
--net=host \
--pid=host \
--privileged \
-v /var/run:/var/run \
--name $(NAME) $(IMAGE)
$(UPTODATE): $(EXE) Dockerfile
$(SUDO) docker build -t $(IMAGE) .
touch $@
$(EXE): $(shell find . -name *.go)
$(SUDO) docker run --rm \
-v "$$PWD":/go/src/hosting/org/$(EXE) \
-v $(shell pwd)/../../../vendor:/go/src/hosting/org/$(EXE)/vendor \
-w /go/src/hosting/org/$(EXE) \
golang:1.6 go build -v
clean:
- rm -rf $(UPTODATE) $(EXE)
- $(SUDO) docker rmi $(IMAGE)