编译可以在scratch docker中运行的go程序需要加如下编译参数,使其不链接动态库
-ldflags ‘-linkmode “external” -extldflags “-static”’
go交叉编译
CGO_ENABLE=0 GOOS=windows GOARCH=amd64
go mod i/o timeout
export GOPROXY=https://goproxy.io
export GO111MODULE=on
编译可以在scratch docker中运行的go程序需要加如下编译参数,使其不链接动态库
-ldflags ‘-linkmode “external” -extldflags “-static”’
go交叉编译
CGO_ENABLE=0 GOOS=windows GOARCH=amd64
go mod i/o timeout
export GOPROXY=https://goproxy.io
export GO111MODULE=on