diff --git a/.gitignore b/.gitignore index 830caffec..b35e97f66 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,3 @@ experimental/_integration/_integration *sublime-project *sublime-workspace *npm-debug.log - diff --git a/Makefile b/Makefile index 3d7933137..7106fb37c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all deps static clean client-lint client-test client-sync +.PHONY: all deps static clean client-lint client-test client-sync backend # If you can use Docker without being root, you can `make SUDO= ` SUDO=sudo @@ -11,6 +11,7 @@ SCOPE_IMAGE=$(DOCKERHUB_USER)/scope SCOPE_EXPORT=scope.tar SCOPE_UI_BUILD_EXPORT=scope_ui_build.tar SCOPE_UI_BUILD_IMAGE=$(DOCKERHUB_USER)/scope-ui-build +SCOPE_BACKEND_BUILD_IMAGE=$(DOCKERHUB_USER)/scope-backend-build SCOPE_VERSION=$(shell git rev-parse --short HEAD) DOCKER_VERSION=1.3.1 DOCKER_DISTRIB=docker/docker-$(DOCKER_VERSION).tgz @@ -76,6 +77,10 @@ $(SCOPE_UI_BUILD_EXPORT): client/Dockerfile client/package.json client/webpack.l docker build -t $(SCOPE_UI_BUILD_IMAGE) client docker save $(SCOPE_UI_BUILD_IMAGE):latest > $@ +backend: + docker build -t $(SCOPE_BACKEND_BUILD_IMAGE) backend + docker run -ti -v $(shell pwd):/go/src/github.com/weaveworks/scope $(SCOPE_BACKEND_BUILD_IMAGE) /build.bash + clean: go clean ./... rm -rf $(SCOPE_EXPORT) $(SCOPE_UI_BUILD_EXPORT) $(APP_EXE) $(PROBE_EXE) client/build/app.js diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..dc2716f1e --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,4 @@ +FROM golang:1.5.1 +RUN apt-get update && apt-get install -y libpcap-dev +COPY build.bash / + diff --git a/backend/build.bash b/backend/build.bash new file mode 100755 index 000000000..134cf557b --- /dev/null +++ b/backend/build.bash @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x + +# Mount the scope repo: +# -v $(pwd):/go/src/github.com/weaveworks/scope + +cd /go/src/github.com/weaveworks/scope +make deps +make app/scope-app +make probe/scope-probe +