Skip to content

Commit 41907f3

Browse files
committed
fix: CGO_ENABLE for build
1 parent fa3ae91 commit 41907f3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
# =========================
44
FROM golang:1.25-alpine AS builder
55

6-
ENV CGO_ENABLED=0 \
6+
# CGO is required for herumi/bls-eth-go-binary
7+
ENV CGO_ENABLED=1 \
78
GOOS=linux \
89
GOARCH=amd64
910

11+
# Install build dependencies for CGO
12+
RUN apk add --no-cache gcc musl-dev
13+
1014
WORKDIR /app
1115
COPY go.mod go.sum ./
1216
RUN go mod download
@@ -18,7 +22,10 @@ RUN go build -o /app/bin/app ./cmd/...
1822
# Stage 2: runtime
1923
# =========================
2024
FROM alpine:3.20
21-
RUN adduser -D -u 10001 appuser
25+
26+
# Install runtime dependencies for CGO binary
27+
RUN apk add --no-cache libc6-compat && \
28+
adduser -D -u 10001 appuser
2229

2330
WORKDIR /home/appuser
2431

0 commit comments

Comments
 (0)