採用 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