Move to extras directory, add Makefile, Dockerfile

This commit is contained in:
Bryan Boreham
2018-11-15 18:17:27 +00:00
parent 2ffb4bc32b
commit 7143356fd5
3 changed files with 34 additions and 0 deletions

10
extras/scanner/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM alpine:3.8
RUN apk add --no-cache ca-certificates
COPY scanner /bin/scanner
EXPOSE 6060
ENTRYPOINT [ "/bin/scanner" ]
ARG revision
LABEL org.opencontainers.image.title="scanner" \
org.opencontainers.image.source="https://github.com/weaveworks/scope/app/multitenant/scanner" \
org.opencontainers.image.revision="${revision}"

24
extras/scanner/Makefile Normal file
View File

@@ -0,0 +1,24 @@
.PHONY: all vet lint build test clean
GIT_REVISION := $(shell git rev-parse HEAD)
GO_BUILD_FLAGS=$(GO_BUILD_INSTALL_DEPS) -ldflags "-extldflags \"-static\" -s -w" -tags netgo
all: build test vet lint
vet:
go vet ./...
lint:
golint .
build:
go build $(GO_BUILD_FLAGS)
test:
go test
docker:
docker build --build-arg=revision=$(GIT_REVISION) -t quay.io/weaveworks/scope-deleter .
clean:
go clean