Hello!
I am trying to make a completely self contained executable for my project, but I am unable to statically link TensorFlow. No linking flags or bazel build options help.
Any advice?
Thanks!
评论:
phillydogg28:
wheey:I followed this article to learn how to do it. In the end I created a Dockerfile that used the golang base image, installed musl, then a build command with:
CC=/usr/local/musl/bin/musl-gcc GOOS=linux go build --ldflags '-linkmode external -extldflags "-static"' github.com/company/project
chocol4tebubble5:Could you please provide a example which you already have tried and version of Go - would be appreciated.
Sorry, I am on version 1.9. I've used "CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' " as well as the same flags with cgo.
