forked from dcb9/janus
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
38 lines (27 loc) · 937 Bytes
/
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
37
38
ARG GO_VERSION=1.18
ARG ALPINE_VERSION=3.16
FROM golang:${GO_VERSION}-alpine as builder
RUN apk add --no-cache make gcc musl-dev git
WORKDIR $GOPATH/src/github.com/qtumproject/janus
COPY go.mod go.sum $GOPATH/src/github.com/qtumproject/janus/
# Cache go modules
RUN go mod download -x
ARG GIT_SHA
ENV CGO_ENABLED=0
COPY ./ $GOPATH/src/github.com/qtumproject/janus
ENV GIT_SHA=$GIT_SH
RUN go build \
-ldflags \
"-X 'github.com/qtumproject/janus/pkg/params.GitSha=`./sha.sh`'" \
-o $GOPATH/bin $GOPATH/src/github.com/qtumproject/janus/... && \
rm -fr $GOPATH/src/github.com/qtumproject/janus/.git
# Final stage
FROM alpine:${ALPINE_VERSION} as base
# Makefile supports generating ssl files from docker
RUN apk add --no-cache openssl
COPY --from=builder /go/bin/janus /janus
ENV QTUM_RPC=http://qtum:testpasswd@localhost:3889
ENV QTUM_NETWORK=auto
EXPOSE 23889
EXPOSE 23890
ENTRYPOINT [ "/janus" ]