fix go build with sqlite
This commit is contained in:
parent
0bd065c2d1
commit
f6b6c8a7e6
2 changed files with 6 additions and 4 deletions
|
|
@ -3,8 +3,8 @@ FROM golang:1.25-alpine AS builder
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
# Install git if needed for go mod
|
||||
RUN apk add --no-cache git
|
||||
# Install git, gcc, musl-dev, and sqlite-dev for go mod and CGO
|
||||
RUN apk add --no-cache git gcc musl-dev sqlite-dev
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
|
|
@ -15,6 +15,9 @@ RUN go mod download
|
|||
COPY main.go .
|
||||
COPY internal ./internal
|
||||
|
||||
# Enable CGO for go-sqlite3
|
||||
ENV CGO_ENABLED=1
|
||||
|
||||
RUN go build -o main .
|
||||
|
||||
FROM alpine:latest
|
||||
|
|
|
|||
3
go.mod
3
go.mod
|
|
@ -5,6 +5,5 @@ go 1.25.0
|
|||
require (
|
||||
git.travisshears.com/travisshears/gemlog-cli v1.1.0
|
||||
github.com/kulak/gemini v1.2.2
|
||||
github.com/mattn/go-sqlite3 v1.14.32
|
||||
)
|
||||
|
||||
require github.com/mattn/go-sqlite3 v1.14.32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue