mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
build: use pre-built binary in Dockerfile
GoReleaser copies the compiled binary into the Docker context. Dockerfile should COPY the binary, not rebuild from source.
This commit is contained in:
+1
-10
@@ -1,14 +1,5 @@
|
||||
FROM golang:1.26-alpine AS builder
|
||||
ARG TARGETARCH
|
||||
RUN apk add --no-cache git make
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
COPY vendor/ vendor/
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH:-amd64} go build -mod=vendor -o /mpcd ./cmd/mpcd/
|
||||
|
||||
FROM alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY --from=builder /mpcd /usr/local/bin/mpcd
|
||||
COPY mpcd /usr/local/bin/mpcd
|
||||
EXPOSE 8081
|
||||
ENTRYPOINT ["mpcd"]
|
||||
|
||||
Reference in New Issue
Block a user