如何将Go应用程序部署到Bluemix?

huangapple go评论81阅读模式
英文:

How to deploy a Go application to Bluemix?

问题

我正在使用Bluemix来运行应用程序,我可以将Java应用程序部署到Bluemix,有人知道如何将Go应用程序部署到Bluemix吗?

英文:

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?

答案1

得分: 2

你可以将Go应用部署到Bluemix,但需要提供Go Buildpack URL时使用-b参数。

这里有一个示例应用程序供你参考:
https://github.com/acostry/Go-on-Bluemix

英文:

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

答案2

得分: 2

你需要使用自定义的构建包来部署一个Go Web应用程序。因此,请登录到你的云平台,并在应用程序的根目录下运行以下cf命令:

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

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

答案3

得分: 1

实际上,Bluemix现在在其目录中包含了Cloud Foundry Go构建包https://github.com/cloudfoundry/go-buildpack。因此,应该不需要使用BYOB功能。

API端点:https://api.ng.bluemix.net(API版本:2.19.0)

mbp:utils cbf $ cf buildpacks
获取构建包...

构建包 位置 启用 锁定 文件名
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

英文:

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

答案4

得分: 0

将应用程序部署到Bluemix与部署其他应用程序基本相同,唯一的区别是需要使用命令行标志来设置自定义构建包,以便平台可以为运行时提供支持。

登录到您的Bluemix帐户,并从应用程序的根文件夹运行以下命令,其中appname表示您的Bluemix托管应用程序的唯一名称:

cf push appname -b url

有关创建/推送/部署/连接的更多详细信息,请访问http://www.ibm.com/developerworks/cloud/library/cl-bluemix-go-app/

英文:

Deploying the app to Bluemix is pretty much the same as deploying any other app, with the exception of a command-line flag to set the custom buildpack the platform should use to provision the runtime.

Log in to your Bluemix account and run this command from the root folder of your application, where appname represents a unique name for your Bluemix-hosted app:

cf push appname -b url

More details regrading creating/pushing/deploying/connecting can be found at http://www.ibm.com/developerworks/cloud/library/cl-bluemix-go-app/

答案5

得分: 0

只是为了明确起见,完整的命令如下所示。

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

英文:

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

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

答案6

得分: 0

使用-b选项发出以下命令,使用自己的构建包部署应用程序,其中buildpack_URL是构建包的URL:

$ cf push app_name -b buildpack_URL

更具体地说,

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

更多信息请参考以下链接:

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

英文:

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.

答案7

得分: 0

你在将Go应用程序推送到Bluemix云时,必须包含"-b"选项。

cf push app_name -b buildpack_URL

对于其他类型的应用程序,你可以参考以下链接来将应用程序推送到Bluemix:

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

英文:

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.

huangapple
  • 本文由 发表于 2014年11月27日 20:20:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/27170698.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定