mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Add a test script * add gh action for build and test * added all the test * Change github workflow to use the new test script * Change the docker file to use the new test script * Add doc comment for ProtocolError.Unwrap() * Use another github action to increase windows page size * Run the action after any edit to the PR metadata/base * Change go version from 1.15 to 1.14 * Rename test.sh to build_and_test.sh Co-authored-by: Isabella Liu <isabellaliu77@gmail.com>
34 lines
888 B
Docker
34 lines
888 B
Docker
# -- multistage docker build: stage #1: build stage
|
|
FROM golang:1.14-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 ./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/sample-kaspad.conf /app/
|
|
|
|
USER nobody
|
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|