嗨,当我将二进制文件推送到 cf 时,我们看到下载了错误的 go 版本
推送代码的步骤
运行构建命令
GOOS="linux" GOARCH=amd64 go build ${LDFLAGS} -o localdeploy/some-app main.go
cd本地部署
cf push -f 清单.yml
注意:localdeploy 文件夹包含 manifest.yml 和 some-app 二进制文件
Go.mod文件
go 1.16
require (
github.com/cloudfoundry-community/go-cfenv v1.18.0
github.com/gin-gonic/gin v1.8.1
github.com/google/uuid v1.3.0
github.com/rs/zerolog v1.28.0
github.com/stretchr/testify v1.8.0
)
清单文件.yml
applications:
- name: some-app-1000-snapshot
command: ./some-app
stack: cflinuxfs3
buildpacks:
- https://github.com/cloudfoundry/binary-buildpack.git
Then i see following logs downloading go 1.15.5 instead of go 1.16
Below are the logs getting when pushed to cf --- application is working but why it is downloading 1.15 instead of 1.16 which is present in my mod file
Staging app and tracing logs...
-----> Download go 1.15.5
-----> Running go build supply
/tmp/buildpackdownloads/d612ac0e3047b21e80ecfeae72c39f81 ~
~
-----> Binary Buildpack version 1.0.46
-----> Download go 1.15.5
-----> Running go build finalize
/tmp/buildpackdownloads/d612ac0e3047b21e80ecfeae72c39f81 ~```
ABOUTYOU
相关分类