How to deploy a Go application to Bluemix?

2019-08-07 13:45发布

I am using Bluemix to run app, I can deploy Java app to Bluemix, does anyone know how to deploy a Go App to Bluemix?

标签: go ibm-cloud
7条回答
爷、活的狠高调
2楼-- · 2019-08-07 14:14

Actually, Bluemix now includes the Cloud Foundry Go buildpack https://github.com/cloudfoundry/go-buildpack in its catalog. Hence, it should be unnecessary to resort to use of the BYOB feature.

API endpoint: https://api.ng.bluemix.net (API version: 2.19.0)

mbp:utils cbf$ cf buildpacks
Getting buildpacks...

buildpack                              position   enabled   locked   filename   
liberty-for-java                       1          true      false    buildpack_liberty-for-java_v1.15-20150402-1422-yp.zip   
sdk-for-nodejs                         2          true      false    buildpack_sdk-for-nodejs_v1.15-20150331-2231-yp.zip   
noop-buildpack                         3          true      false    noop-buildpack-20140311-1519.zip   
java_buildpack                         4          true      false    java-buildpack-v2.6.zip   
ruby_buildpack                         5          true      false    ruby_buildpack-offline-v1.2.0.zip   
nodejs_buildpack                       6          true      false    nodejs_buildpack-offline-v1.1.1.zip   
go_buildpack                           7          true      false    go_buildpack-offline-v1.1.1.zip   
python_buildpack                       8          true      false    python_buildpack-offline-v1.1.1.zip   
php_buildpack                          9          true      false    php_buildpack-offline-v1.0.2.zip   
liberty-for-java_v1-14-20150319-1159   10         true      false    buildpack_liberty-for-java_v1.14-20150319-1159-yp.zip   
sdk-for-nodejs_v1-14-20150309-1555     11         true      false    buildpack_sdk-for-nodejs_v1.14-20150309-1555-yp.zip
查看更多
冷血范
3楼-- · 2019-08-07 14:15

Just to be clear the full command would be the following.

cf push appname -b https://github.com/cloudfoundry/go-buildpack.git

查看更多
三岁会撩人
4楼-- · 2019-08-07 14:16

Issue the following command with the -b option to deploy your application with your own buildpack, in which buildpack_URL is the URL of the buildpack:

$ cf push app_name -b buildpack_URL

More specifically

cf push app_name -b https://github.com/cloudfoundry/go-buildpack.git

more info is below:

https://www.ng.bluemix.net/docs/#starters/byob.html.

查看更多
你好瞎i
5楼-- · 2019-08-07 14:17

You have to include "-b" option while pushing your go app on Bluemix cloud.

cf push app_name -b buildpack_URL

For any other types of app, you can refer below link for pushing app on bluemix:

https://www.ng.bluemix.net/docs/#starters/byob.html.

查看更多
贼婆χ
6楼-- · 2019-08-07 14:22

You can deploy a Go application to Bluemix, but need to supply -b with the Go Buildpack URL.

There is a sample application you can take a look: https://github.com/acostry/Go-on-Bluemix

查看更多
你好瞎i
7楼-- · 2019-08-07 14:28

You need to use a custom buildpack to deploy a Go web application. So, login to your cloud and run the cf command below from the root folder of your application:

cf push appname -b https://github.com/cloudfoundry/cloudfoundry-buildpack-go
查看更多
登录 后发表回答