2021-03-19 16:32:52 +07:00
|
|
|
FROM golang:1.16-alpine3.13 as builder
|
2020-10-02 15:16:21 +07:00
|
|
|
|
2020-10-30 09:43:24 +01:00
|
|
|
ARG git_commit
|
|
|
|
ENV GIT_COMMIT=$git_commit
|
|
|
|
|
2021-03-01 11:02:06 +07:00
|
|
|
ARG git_branch
|
|
|
|
ENV GIT_BRANCH=$git_branch
|
|
|
|
|
2020-10-30 09:43:24 +01:00
|
|
|
# for linters to avoid warnings. we won't use linters in Docker anyway
|
|
|
|
ENV LATEST_COMMIT="undefined"
|
|
|
|
|
2020-10-28 10:18:10 +07:00
|
|
|
RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++
|
2016-11-15 17:57:56 +00:00
|
|
|
|
2020-08-21 14:38:11 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-04-11 14:22:23 +07:00
|
|
|
# next 2 lines helping utilize docker cache
|
2020-08-21 14:38:11 +02:00
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
2020-04-11 14:22:23 +07:00
|
|
|
|
2020-08-21 14:38:11 +02:00
|
|
|
ADD . .
|
2020-08-27 13:45:24 +07:00
|
|
|
RUN make all
|
2017-09-05 12:16:59 +03:00
|
|
|
|
2021-03-19 16:32:52 +07:00
|
|
|
FROM alpine:3.13
|
2016-11-15 17:57:56 +00:00
|
|
|
|
2020-10-13 13:56:16 +01:00
|
|
|
RUN apk add --no-cache ca-certificates libgcc libstdc++
|
2020-08-01 14:39:04 +07:00
|
|
|
COPY --from=builder /app/build/bin/* /usr/local/bin/
|
2016-11-15 17:57:56 +00:00
|
|
|
|
2020-09-14 04:25:15 +08:00
|
|
|
EXPOSE 8545 8546 30303 30303/udp 8080 9090 6060
|