Fantom-foundation/go-lachesis

View on GitHub
docker/Dockerfile.lachesis

Summary

Maintainability
Test Coverage
FROM golang:1.13-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git
                                                                                                                                                                                        
WORKDIR /go/go-lachesis
COPY . .

ARG GOPROXY=direct
RUN go mod download

RUN export GIT_COMMIT=$(git rev-list -1 HEAD) && \
    export GIT_DATE=$(git log -1 --date=short --pretty=format:%ct) && \
    export CGO_ENABLED=1 && \
    go build -ldflags "-s -w -X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_DATE" \
    -o /tmp/lachesis \
    ./cmd/lachesis



FROM alpine:latest

RUN apk add --no-cache ca-certificates

COPY --from=builder /tmp/lachesis /
COPY ./docker/test_accs.json /tmp/
COPY ./docker/fakepassword /tmp/fakepassword

EXPOSE 5050 18545 18546 18547 19090

ENTRYPOINT ["/lachesis"]