更新於 2024/09/14閱讀時間約 3 分鐘

sqlite 問題

    採用 alpine 作為 Docker image

    Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub


    make[1]: Entering directory `/vagrant/go/src/github.com/.....​'
    docker logs -f -t --tail 20 vote
    2023-09-15T00:18:53.960163750Z exec /app/app: no such file or directory

    先看一下編譯的指令

    build:
    GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=off go build -a -tags netgo \
    -ldflags "-s -w -X version.Release=${RELEASE} \ -X version.Commit=${COMMIT} \ -X version.BuildTime=${BUILD_TIME}" \
    -o app
    付費訂閱
    分享至
    成為作者繼續創作的動力吧!
    © 2024 vocus All rights reserved.