Browse Source

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.
pull/7185/head
chrislu 1 month ago
parent
commit
88d86374ea
  1. 8
      test/postgres/Dockerfile.seaweedfs

8
test/postgres/Dockerfile.seaweedfs

@ -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

Loading…
Cancel
Save