kaspad/docker/Dockerfile
2023-08-23 15:18:10 +09:00

32 lines
697 B
Docker

# -- multistage docker build: stage #1: build stage
FROM golang:1.19-alpine AS build
RUN mkdir -p /go/src/github.com/c4ei/kaspad
WORKDIR /go/src/github.com/c4ei/kaspad
RUN apk add --no-cache curl git openssh binutils gcc musl-dev
COPY go.mod .
COPY go.sum .
# Cache kaspad dependencies
RUN go mod download
COPY . .
RUN go build $FLAGS -o kaspad .
# --- 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/c4ei/YunSeokYeol/kaspad /app/
COPY --from=build /go/src/github.com/c4ei/YunSeokYeol/infrastructure/config/sample-kaspad.conf /app/
USER nobody
ENTRYPOINT [ "/sbin/tini", "--" ]