From d3550357d10966efc2d12d8125dd8c6fa1eb27b3 Mon Sep 17 00:00:00 2001 From: Edvard Date: Mon, 21 Jan 2019 11:17:39 +0100 Subject: [PATCH] Add initial dockerfile and .dockerignore --- .dockerignore | 18 ++++++++++++++++++ Dockerfile | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..01c7726c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +.git +.travis.yml +.idea +bin +db +.gitignore +environments +integration_test +LICENSE +postgraphile +.private_blockchain_password +README.md +scripts +Supfile +test_config +.travis.yml +vulcanizedb.log + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f749245e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:alpine as builder +RUN apk --update --no-cache add make git g++ + +# Build statically linked vDB binary (wonky path because of Dep) +RUN mkdir -p /go/src/github.com/vulcanize/vulcanizedb +ADD . /go/src/github.com/vulcanize/vulcanizedb +WORKDIR /go/src/github.com/vulcanize/vulcanizedb +RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' . + +# Second stage +FROM scratch +COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/vulcanizedb /app/vulcanizedb +WORKDIR /app +CMD ["./vulcanizedb", "--help"]