forked from hyperledger-archives/burrow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# We use a multistage build to avoid bloating our deployment image with build dependencies
FROM golang:1.9.0-alpine3.6 as builder
MAINTAINER Monax <[email protected]>
RUN apk add --no-cache --update git
RUN go get github.com/Masterminds/glide
ARG REPO=$GOPATH/src/github.com/hyperledger/burrow
COPY . $REPO
WORKDIR $REPO
RUN glide install
# Build purely static binaries
RUN go build --ldflags '-extldflags "-static"' -o bin/burrow ./cmd/burrow
RUN go build --ldflags '-extldflags "-static"' -o bin/burrow-client ./client/cmd/burrow-client
# This will be our base container image
FROM alpine:3.6
ARG REPO=/go/src/github.com/hyperledger/burrow
ENV USER monax
ENV MONAX_PATH /home/$USER/.monax
RUN addgroup -g 101 -S $USER && adduser -S -D -u 1000 $USER $USER
WORKDIR $MONAX_PATH
USER $USER:$USER
# Copy binaries built in previous stage
COPY --from=builder $REPO/bin/* /usr/local/bin/
# Expose ports for 1337:burrow API; 46656:tendermint-peer; 46657:tendermint-rpc
EXPOSE 1337
EXPOSE 46656
EXPOSE 46657
CMD [ "burrow", "serve" ]