24 lines
700 B
Docker
24 lines
700 B
Docker
FROM golang:1.25-bookworm AS builder
|
|
|
|
ARG MOONBRIDGE_REPO=https://github.com/ZhiYi-R/moon-bridge.git
|
|
ARG MOONBRIDGE_REF=1b99888d3dae889b79ee602cb875c7907f7e76f2
|
|
|
|
ENV GOPROXY=https://goproxy.cn,direct
|
|
|
|
WORKDIR /src
|
|
RUN git clone --filter=blob:none "${MOONBRIDGE_REPO}" moon-bridge
|
|
WORKDIR /src/moon-bridge
|
|
RUN git checkout "${MOONBRIDGE_REF}" \
|
|
&& go mod download \
|
|
&& CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/moonbridge ./cmd/moonbridge
|
|
|
|
FROM scratch
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
COPY --from=builder /out/moonbridge /app/moonbridge
|
|
|
|
EXPOSE 4001
|
|
USER 65532:65532
|
|
ENTRYPOINT ["/app/moonbridge"]
|