add Dockerfile and Makefile tasks to build statusd-prune docker image (#1005)
* add Dockerfile and Makefile tasks to build statusd-prune docker image * add image ENTRYPOINT * set default CMD to statusd-prune
This commit is contained in:
parent
cfa5e2b6e3
commit
5d0120ee28
12
Makefile
12
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: statusgo all test xgo clean help
|
||||
.PHONY: statusgo statusd-prune all test xgo clean help
|
||||
.PHONY: statusgo-android statusgo-ios
|
||||
|
||||
help: ##@other Show this help
|
||||
|
@ -25,6 +25,7 @@ gotest_extraflags =
|
|||
|
||||
DOCKER_IMAGE_NAME ?= statusteam/status-go
|
||||
BOOTNODE_IMAGE_NAME ?= statusteam/bootnode
|
||||
STATUSD_PRUNE_IMAGE_NAME ?= statusteam/statusd-prune
|
||||
|
||||
DOCKER_TEST_WORKDIR = /go/src/github.com/status-im/status-go/
|
||||
DOCKER_TEST_IMAGE = golang:1.10
|
||||
|
@ -57,6 +58,15 @@ statusgo: ##@build Build status-go as statusd server
|
|||
@echo "Compilation done."
|
||||
@echo "Run \"build/bin/statusd -h\" to view available commands."
|
||||
|
||||
statusd-prune: ##@statusd-prune Build statusd-prune
|
||||
go build -o $(GOBIN)/statusd-prune -v ./cmd/statusd-prune
|
||||
@echo "Compilation done."
|
||||
@echo "Run \"build/bin/statusd-prune -h\" to view available commands."
|
||||
|
||||
statusd-prune-docker-image: ##@statusd-prune Build statusd-prune docker image
|
||||
@echo "Building docker image..."
|
||||
docker build --file _assets/build/Dockerfile-prune . -t $(STATUSD_PRUNE_IMAGE_NAME):latest
|
||||
|
||||
bootnode: ##@build Build discovery v5 bootnode using status-go deps
|
||||
go build -i -o $(GOBIN)/bootnode -v -tags '$(BUILD_TAGS)' $(BUILD_FLAGS) ./cmd/bootnode/
|
||||
@echo "Compilation done."
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# Build status-go in a Go builder container
|
||||
FROM golang:1.10-alpine as builder
|
||||
|
||||
RUN apk add --no-cache make gcc musl-dev linux-headers
|
||||
|
||||
RUN mkdir -p /go/src/github.com/status-im/status-go
|
||||
ADD . /go/src/github.com/status-im/status-go
|
||||
RUN cd /go/src/github.com/status-im/status-go && make statusd-prune
|
||||
|
||||
# Copy the binary to the second image
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache ca-certificates bash
|
||||
|
||||
COPY --from=builder /go/src/github.com/status-im/status-go/build/bin/statusd-prune /usr/local/bin/
|
||||
|
||||
CMD ["statusd-prune"]
|
Loading…
Reference in New Issue