mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-13 01:26:43 +00:00

* Refactor miner and mine when waiting for block to validate * Fix -n to work after the refactor. Change foundBlockChan capacity. Use lock instead of atomic in the template manager. * Fix self assignment * Fix lock * Fix Dockerfile * Add comment
34 lines
924 B
Docker
34 lines
924 B
Docker
# -- multistage docker build: stage #1: build stage
|
|
FROM golang:1.15-alpine AS build
|
|
|
|
RUN mkdir -p /go/src/github.com/kaspanet/kaspad
|
|
|
|
WORKDIR /go/src/github.com/kaspanet/kaspad
|
|
|
|
RUN apk add --no-cache curl git openssh binutils gcc musl-dev
|
|
RUN go get -u golang.org/x/lint/golint \
|
|
github.com/kisielk/errcheck \
|
|
github.com/opennota/check/cmd/aligncheck \
|
|
github.com/opennota/check/cmd/structcheck \
|
|
github.com/opennota/check/cmd/varcheck \
|
|
honnef.co/go/tools/cmd/staticcheck
|
|
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
|
|
COPY . .
|
|
|
|
RUN NO_PARALLEL=1 ./build_and_test.sh
|
|
|
|
# --- multistage docker build: stage #2: runtime image
|
|
FROM alpine
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache ca-certificates tini
|
|
|
|
COPY --from=build /go/src/github.com/kaspanet/kaspad/kaspad /app/
|
|
COPY --from=build /go/src/github.com/kaspanet/kaspad/infrastructure/config/sample-kaspad.conf /app/
|
|
|
|
USER nobody
|
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|