mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
fix: multi-stage Dockerfile, remove prebuilt — Go 1.26, alpine 3.21, GOPRIVATE for private deps
This commit is contained in:
+19
-3
@@ -1,5 +1,21 @@
|
||||
FROM alpine:3.20
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git ca-certificates
|
||||
|
||||
ARG GITHUB_TOKEN
|
||||
RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
ENV GOPRIVATE=github.com/luxfi/*,github.com/hanzoai/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o mpcd ./cmd/mpcd
|
||||
|
||||
FROM alpine:3.21
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY mpcd /usr/local/bin/mpcd
|
||||
EXPOSE 8081
|
||||
COPY --from=builder /app/mpcd /usr/local/bin/mpcd
|
||||
EXPOSE 8081 9651 9800
|
||||
ENTRYPOINT ["mpcd"]
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
FROM alpine:3.20
|
||||
ARG TARGETARCH
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY mpcd-linux-${TARGETARCH} /usr/local/bin/mpcd
|
||||
RUN chmod +x /usr/local/bin/mpcd
|
||||
EXPOSE 8081 9651 9800
|
||||
ENTRYPOINT ["mpcd"]
|
||||
Reference in New Issue
Block a user