release 2.1.0 rc.2 (#1995)

This commit is contained in:
澄潭
2025-04-01 15:32:33 +08:00
committed by GitHub
parent a602f7a725
commit 639956c0b8
17 changed files with 73 additions and 53 deletions

View File

@@ -1,29 +1,12 @@
# Build stage
FROM golang:1.24 AS builder
ARG SERVER_NAME=quark-search
ARG GOPROXY
WORKDIR /app
# Copy the server code
COPY ${SERVER_NAME}/ .
# Set GOPROXY if provided
RUN if [ -n "$GOPROXY" ]; then go env -w GOPROXY=${GOPROXY}; fi
# Build the WASM binary
RUN GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o main.wasm main.go
# Final stage
# Single stage build using pre-built WASM binary
FROM scratch
ARG SERVER_NAME=quark-search
WORKDIR /
# Copy the WASM binary from the builder stage
COPY --from=builder /app/main.wasm /main.wasm
# Copy the pre-built WASM binary from local build
COPY ${SERVER_NAME}/main.wasm /plugin.wasm
# Metadata
LABEL org.opencontainers.image.title="${SERVER_NAME}"