Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1b01ec18f | |||
| d271a786d2 |
+8
-5
@@ -1,7 +1,10 @@
|
||||
# Build stage
|
||||
FROM golang:1.25-alpine AS builder
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
ENV GOTOOLCHAIN=auto
|
||||
|
||||
# Install build dependencies for SQLite3
|
||||
RUN apk add --no-cache git gcc musl-dev
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -13,10 +16,10 @@ RUN go mod download
|
||||
COPY server/ ./
|
||||
COPY agent/ ../agent/
|
||||
|
||||
# Build server
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-server ./cmd/server
|
||||
# Build server with CGO enabled for SQLite3
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w -linkmode external -extldflags '-static'" -o /nuyue-server ./cmd/server
|
||||
|
||||
# Build agent
|
||||
# Build agent (no CGO needed)
|
||||
RUN cd ../agent && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-agent ./cmd/agent
|
||||
|
||||
# Runtime stage
|
||||
|
||||
Reference in New Issue
Block a user