fix(docker): Fix go-sqlite3 compilation on Alpine Linux

Add CGO_CFLAGS="-D_LARGEFILE64_SOURCE" to resolve musl libc compatibility
issues. This enables the Large File Support feature macros which map
pread64/pwrite64/off64_t symbols (used by SQLite) to musl's native
pread/pwrite/off_t implementations.
This fix eliminates the "undeclared identifier" errors during CGO
compilation without requiring additional sqlite-dev dependencies.
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
This commit is contained in:
tangmengqiu
2025-11-02 17:15:01 -05:00
parent f5dc441c20
commit 806fad6136
2 changed files with 11 additions and 1 deletions

View File

@@ -47,7 +47,9 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -trimpath -ldflags="-s -w" -o nofx .
RUN CGO_ENABLED=1 GOOS=linux \
·
go build -trimpath -ldflags="-s -w" -o nofx .
# ──────────────────────────────────────────────────────────────
# Runtime Stage (Minimal Executable Environment)