mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-06 08:07:05 +00:00
fix: Enable CGO in Docker build for pg_query_go dependency
The pg_query_go library requires CGO to be enabled as it wraps the libpg_query C library. Added gcc and musl-dev dependencies to the Docker build for proper compilation.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
# Install git and other build dependencies
|
||||
RUN apk add --no-cache git make
|
||||
# Install build dependencies including gcc for CGO (required by pg_query_go)
|
||||
RUN apk add --no-cache git make gcc musl-dev
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
@@ -13,8 +13,8 @@ RUN go mod download
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the weed binary with all our new features
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o weed ./weed/
|
||||
# Build the weed binary with CGO enabled (required for pg_query_go)
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags "-s -w" -o weed ./weed/
|
||||
|
||||
# Final stage - minimal runtime image
|
||||
FROM alpine:latest
|
||||
|
||||
Reference in New Issue
Block a user