mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-28 09:46:50 +00:00
43 lines
1.2 KiB
Docker
43 lines
1.2 KiB
Docker
# -- multistage docker build: stage #1: build stage
|
|
FROM golang:1.12-alpine AS build
|
|
|
|
RUN mkdir -p /go/src/github.com/daglabs/btcd
|
|
|
|
WORKDIR /go/src/github.com/daglabs/btcd
|
|
|
|
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
|
|
|
|
# GO111MODULE=on forces Go to use the go-module system
|
|
# TODO: remove this once Go 1.13 is released
|
|
ENV GO111MODULE=on
|
|
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN go vet ./...
|
|
# RUN aligncheck ./...
|
|
# RUN structcheck -e ./...
|
|
# RUN varcheck -e ./...
|
|
RUN cd dnsseeder && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o dnsseeder .
|
|
|
|
# --- 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/daglabs/btcd/dnsseeder/ /app/
|
|
|
|
USER nobody
|
|
CMD [ "/app/dnsseeder", "-H", "dnsseed.my.home", "-n", "192.168.16.104", "-l", "0.0.0.0:53", "-s", "localhost", "--testnet" ]
|
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|