mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-21 22:36:39 +00:00
Makefile: first cut at porting the Docker instructions
This commit is contained in:
committed by
Tom Wilkie
parent
5ad24319f2
commit
b003336a46
32
Makefile
32
Makefile
@@ -1,7 +1,14 @@
|
||||
.PHONY: all build client static dist test clean
|
||||
|
||||
APP=app/app
|
||||
FIXPROBE=experimental/fixprobe/fixprobe
|
||||
# If you can use Docker without being root, you can `make SUDO= <target>`
|
||||
SUDO=sudo
|
||||
|
||||
DOCKERHUB_USER=weaveworks
|
||||
APP_EXE=app/app
|
||||
PROBE_EXE=probe/probe
|
||||
FIXPROBE_EXE=experimental/fixprobe/fixprobe
|
||||
SCOPE_IMAGE=$(DOCKERHUB_USER)/scope
|
||||
SCOPE_EXPORT=scope.tar
|
||||
|
||||
all: build
|
||||
|
||||
@@ -17,16 +24,29 @@ static:
|
||||
|
||||
dist: client static build
|
||||
|
||||
test: ${APP} ${FIXPROBE}
|
||||
test: $(APP_EXE) $(FIXPROBE_EXE)
|
||||
# app and fixprobe needed for integration tests
|
||||
go test ./...
|
||||
|
||||
${APP}:
|
||||
$(APP_EXE):
|
||||
cd app && go build
|
||||
|
||||
${FIXPROBE}:
|
||||
$(FIXPROBE_EXE):
|
||||
cd experimental/fixprobe && go build
|
||||
|
||||
$(PROBE_EXE):
|
||||
cd probe && go build
|
||||
|
||||
$(SCOPE_EXPORT): Dockerfile $(APP_EXE) $(PROBE_EXE) entrypoint.sh supervisord.conf
|
||||
$(SUDO) docker build -t $(SCOPE_IMAGE) .
|
||||
$(SUDO) docker save $(SCOPE_IMAGE):latest > $@
|
||||
|
||||
docker: $(SCOPE_EXPORT)
|
||||
docker run --privileged -d --name=scope --net=host \
|
||||
-v /proc:/hostproc \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
$(SCOPE_IMAGE)
|
||||
|
||||
clean:
|
||||
go clean ./...
|
||||
|
||||
rm -f $(SCOPE_EXPORT)
|
||||
|
||||
Reference in New Issue
Block a user