mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-22 14:56:56 +00:00
First cut of Docker build for backend
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -52,4 +52,5 @@ experimental/_integration/_integration
|
||||
*sublime-project
|
||||
*sublime-workspace
|
||||
*npm-debug.log
|
||||
|
||||
backend/scope-app
|
||||
backend/scope-probe
|
||||
|
||||
8
Makefile
8
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= <target>`
|
||||
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,11 @@ $(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)/backend:/mount $(SCOPE_BACKEND_BUILD_IMAGE) cp /go/bin/scope-app /mount
|
||||
docker run -ti -v $(shell pwd)/backend:/mount $(SCOPE_BACKEND_BUILD_IMAGE) cp /go/bin/scope-probe /mount
|
||||
|
||||
clean:
|
||||
go clean ./...
|
||||
rm -rf $(SCOPE_EXPORT) $(SCOPE_UI_BUILD_EXPORT) $(APP_EXE) $(PROBE_EXE) client/build/app.js
|
||||
|
||||
5
backend/Dockerfile
Normal file
5
backend/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM golang:1.5.1
|
||||
RUN apt-get update && apt-get install -y libpcap-dev
|
||||
COPY build.bash /
|
||||
RUN /build.bash
|
||||
|
||||
12
backend/build.bash
Executable file
12
backend/build.bash
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p /go/src/github.com/weaveworks
|
||||
cd /go/src/github.com/weaveworks
|
||||
git clone https://github.com/weaveworks/scope
|
||||
cd scope
|
||||
make deps
|
||||
SUDO= make app/scope-app
|
||||
mv app/scope-app $GOPATH/bin
|
||||
SUDO= make probe/scope-probe
|
||||
mv probe/scope-probe $GOPATH/bin
|
||||
|
||||
Reference in New Issue
Block a user