mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-07-14 05:06:14 +00:00
Enable CGO for all GoHoarder binaries to support SQLite
Changes: - Set CGO_ENABLED=1 for gohoarder main binary in .goreleaser.yaml - Add sqlite-libs and musl to Dockerfile.server - Add sqlite-libs and musl to Dockerfile.scanner All Go binaries that interact with SQLite now have CGO enabled: ✅ gohoarder (main binary) - used by server and scanner ✅ migrate (migration tool) Runtime containers include necessary C libraries: ✅ Dockerfile.server - SQLite runtime support ✅ Dockerfile.scanner - SQLite runtime support ✅ Dockerfile.migrate - SQLite runtime support This fixes: 'Binary was compiled with CGO_ENABLED=0, go-sqlite3 requires cgo'
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ builds:
|
|||||||
main: ./cmd/gohoarder
|
main: ./cmd/gohoarder
|
||||||
binary: gohoarder
|
binary: gohoarder
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=1
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- darwin
|
- darwin
|
||||||
|
|||||||
+3
-1
@@ -4,7 +4,7 @@ ARG TARGETARCH
|
|||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
# Install scanning tools and runtime dependencies
|
# Install scanning tools and runtime dependencies (including CGO/SQLite dependencies)
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
tzdata \
|
tzdata \
|
||||||
@@ -12,6 +12,8 @@ RUN apk add --no-cache \
|
|||||||
curl \
|
curl \
|
||||||
wget \
|
wget \
|
||||||
bash \
|
bash \
|
||||||
|
sqlite-libs \
|
||||||
|
musl \
|
||||||
&& update-ca-certificates
|
&& update-ca-certificates
|
||||||
|
|
||||||
# Install Trivy for container scanning
|
# Install Trivy for container scanning
|
||||||
|
|||||||
+3
-1
@@ -4,10 +4,12 @@ ARG TARGETARCH
|
|||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
# Install runtime dependencies
|
# Install runtime dependencies (including CGO/SQLite dependencies)
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
tzdata \
|
tzdata \
|
||||||
|
sqlite-libs \
|
||||||
|
musl \
|
||||||
&& update-ca-certificates
|
&& update-ca-certificates
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user
|
||||||
|
|||||||
Reference in New Issue
Block a user