FROM nimlang/nim:2.0.0-alpine as builder
WORKDIR /project
RUN apk add --update --no-cache --force-overwrite sqlite-dev sqlite-static
COPY . .
RUN nimble build -d:beast -d:release --mm:refc -d:nimDebugDlOpen --passL:-static --verbose -y
FROM alpine:latest
WORKDIR /app
COPY --from=builder --chmod=777 /project/test_happyx ./bin/
COPY --from=builder /project/fighter.db ./
EXPOSE 5000/tcp
ENTRYPOINT ["./bin/test_happyx"]
I don’t know why, but the forum’s markdown editor keeps eating my text.
error info here when start container :
Dynamic loading not supported
Dynamic loading not supported
could not load: libsqlite3.so(|.0)
Lines 68-103 of SQLiteral should effectively guide you towards a solution:
Thanks a lot, it seems helpful for compiling sqlite3.a.
In my case, we have already got it by
add sqlite-static
so I found that I just need to modify it like the following and it will work well
RUN nimble build -d:beast -d:release --mm:refc -d:nimDebugDlOpen --dynlibOverride:sqlite3 --passL:/usr/lib/libsqlite3.a --passL:-static --verbose -y