mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-07-16 05:33:59 +00:00
Enable CGO for migrate binary to support SQLite
Changes: - Set CGO_ENABLED=1 for migrate build in .goreleaser.yaml - Add sqlite-libs and musl runtime dependencies to Dockerfile.migrate This fixes the migration error: 'Binary was compiled with CGO_ENABLED=0, go-sqlite3 requires cgo to work'
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ builds:
|
|||||||
main: ./cmd/migrate
|
main: ./cmd/migrate
|
||||||
binary: migrate
|
binary: migrate
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=1
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- darwin
|
- darwin
|
||||||
|
|||||||
+3
-1
@@ -4,12 +4,14 @@ 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 \
|
||||||
postgresql-client \
|
postgresql-client \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
busybox-extras \
|
busybox-extras \
|
||||||
|
sqlite-libs \
|
||||||
|
musl \
|
||||||
&& update-ca-certificates
|
&& update-ca-certificates
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user
|
||||||
|
|||||||
Reference in New Issue
Block a user