feat: disable CGO_ENABLED (#1766)

* Replace mattn/go-sqlite3 with modernc.org/sqlite

* Disable CGO to make binary work without special c lib

* Replace mattn/go-sqlite3 with modernc.org/sqlite in testing code

* Tidy go module

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
This commit is contained in:
Athurg Gooth
2023-05-29 13:29:42 +08:00
committed by GitHub
parent ce64894abe
commit ddf4cae537
7 changed files with 63 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ RUN apk update && apk add --no-cache gcc musl-dev
COPY . .
COPY --from=frontend /frontend-build/dist ./server/dist
RUN go build -o memos ./main.go
RUN CGO_ENABLED=0 go build -o memos ./main.go
# Make workspace with above generated files.
FROM alpine:3.16 AS monolithic