rogchap / v8go

Execute JavaScript from Go

Home Page:https://rogchap.com/v8go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to properly build go binary that uses v8go inside docker?

begmaroman opened this issue · comments

RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-X 'main.BranchName=' -X 'main.SHA='" -a -tags musl -o nerif-app ./main.go:
#20 60.58 # command-line-arguments
#20 60.58 /usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
#20 60.58 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.9.0/deps/linux_x86_64/libv8.a(platform-posix.o): in function `v8::base::OS::VPrint(char const*, __va_list_tag*)':
#20 60.58 platform-posix.cc:(.text._ZN2v84base2OS6VPrintEPKcP13__va_list_tag+0x1a): undefined reference to `__vfprintf_chk'
#20 60.58 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.9.0/deps/linux_x86_64/libv8.a(platform-posix.o): in function `v8::base::OS::VFPrint(_IO_FILE*, char const*, __va_list_tag*)':

How to properly setup an environment inside docker container in order to successfully build the image?