简体   繁体   English

如何将项目作为Docker从IBM Bluemix PaaS导出到其他任何地方?

[英]How to export a project from IBM Bluemix PaaS to anywhere else as a Docker?

I lead a web/mobile project and I still need to know the tools we will be using for development. 我领导了一个Web /移动项目,但我仍然需要知道我们将用于开发的工具。 We have a 6 months access to IBM Bluemix, and its security check tools, CloudFoundry, and others may appear really useful. 我们有6个月的访问IBM Bluemix的时间,它的安全性检查工具CloudFoundry和其他工具可能真的有用。

However, we don't want to rely on a solution that would trap our project without any possibility of migration if needed. 但是,我们不希望依赖会在没有必要的情况下进行迁移的情况下陷入我们项目的解决方案。

I looked up on the internet how to export a project from Bluemix as a docker, with elements created from IBM. 我在互联网上查找了如何从Bluemix作为docker导出项目,其中包含从IBM创建的元素。 I didn't find anything relevant (I might be bad at googling, but all I can find is "how to export to Bluemix/how to work locally"). 我没有发现任何相关的东西(我可能不擅长使用Google进行谷歌搜索,但是我所能找到的只是“如何导出到Bluemix /如何在本地工作”)。

Does Bluemix allow to export the entire project onto another hoster, does it depend on the services we used in the project ? Bluemix是否允许将整个项目导出到另一个主机上,这取决于我们在项目中使用的服务吗?

Thank you in advance. 先感谢您。

If you package your application in a container you can run it on any provider that supports Docker. 如果将应用程序打包在容器中,则可以在任何支持Docker的提供程序上运行它。 That could be another cloud, in a local datacenter or on your own laptop. 那可能是本地数据中心或您自己的笔记本电脑上的另一个云。

If you are planning to use Bluemix services as part of that application then you will have two options if moving your application off Bluemix. 如果您打算将Bluemix服务用作该应用程序的一部分,那么将应用程序从Bluemix移出将有两个选择。

  1. Keep using the services in Bluemix but connect to them remotely from wherever you're now hosting your appliaction. 继续使用Bluemix中的服务,但是无论您现在托管应用程序的位置如何,都可以远程连接它们。 This will require internet connectivity and you'll have to hard code the service credentials in to your application (not good practice). 这将需要Internet连接,并且您必须将服务凭证硬编码到您的应用程序中(不是很好的做法)。

  2. Migrate the services as well as the application. 迁移服务以及应用程序。 This will only be possible for the non-unique services IBM offer eg Redis, Mongo, Elasticsearch etc.. You'll need to refactor your application to accept the new provider of these services. 这仅适用于IBM提供的非唯一服务,例如Redis,Mongo,Elasticsearch等。您需要重构您的应用程序以接受这些服务的新提供者。

If your service/app is dockerized, and is being hosted as a container on Bluemix. 如果您的服务/应用程序已被docker化,并作为容器托管在Bluemix上。 You can pull the container image of your service/app in your own docker enabled cloud or local environment. 您可以在自己的启用了docker的云或本地环境中提取服务/应用程序的容器映像。 Following steps can be followed for the same: 可以按照以下步骤进行操作:

  1. install bluemix-container cli package https://www.ng.bluemix.net/docs/containers/container_cli_ov.html 安装bluemix-container cli软件包https://www.ng.bluemix.net/docs/containers/container_cli_ov.html
  2. do cf ic login using your bluemix credentials 使用您的bluemix凭证进行cf ic login
  3. check for your images using cf ic images command 使用cf ic images命令检查cf ic images
  4. pull the image in your environment using docker pull <image-registry-url> 使用docker pull <image-registry-url>在您的环境中拉取图像docker pull <image-registry-url>
  5. run the container with required parameters using docker run 使用docker run以必需的参数运行容器

Hope it helps. 希望能帮助到你。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM