简体   繁体   English

在关键云铸造厂上运行Docker映像

[英]Running docker image on pivotal cloud foundry

I have an application that is running in a docker container. 我有一个在Docker容器中运行的应用程序。 Is it possible to deploy this docker container containing the application in Cloud Foundry without making any changes to the application or container itself? 是否可以在Cloud Foundry中部署包含应用程序的docker容器,而无需对应用程序或容器本身进行任何更改?

To answer your specific question about whether you will need to make changes to your Docker image or not, here's the relevant info. 要回答有关是否需要更改Docker映像的特定问题,请参阅以下相关信息。

  • Currently there is no support for mounting volumes or linking containers, but projects to support these use cases are actively in flight, so if your docker run workflow normally involves that you will have to wait. 当前不支持挂载卷或链接容器,但是支持这些用例的项目正在积极进行中,因此,如果您的docker run工作流程通常涉及您,则必须等待。
  • There is only support for v2 Docker registries, so if your image repository is in a Docker registry with an older API, it won't work. 仅支持v2 Docker注册表,因此,如果您的映像存储库位于具有较旧API的Docker注册表中,则它将无法正常工作。
  • There is no support for private repositories (that is, repositories that require a username and password to access the image in the registry). 不支持私有存储库(即,需要用户名和密码才能访问注册表中图像的存储库)。 You can, however, provide your own custom registry and make it only accessible to your CF backend, and then push your image as a public repo to that custom registry. 但是,您可以提供自己的自定义注册表,并使它只能由CF后端访问,然后将映像作为公共存储库推送到该自定义注册表。

(Info filtered from official CF docs site and Diego design notes ) (信息从官方CF docs网站Diego设计说明中筛选出)

As discussed on Cloud Foundry's documentation , you should first enable the diego_docker feature flag with the following command: 如Cloud Foundry 文档中所述 ,您首先应使用以下命令启用diego_docker功能标记:

cf enable-feature-flag diego_docker

Then use the cf push in order to push your docker image. 然后使用cf push来推送您的docker映像。 Versions 6.13.0 and later of the CF CLI include native support for pushing a Docker image as a CF app, with the cf push command's -o or --docker-image flags. CF CLI 6.13.0和更高版本包括对cf push命令的-o--docker-image标志将Docker映像作为CF应用程序推送的本机支持。 For example, running: 例如,运行:

cf push lattice-app -o cloudfoundry/lattice-app

will push the image located at cloudfoundry/lattice-app . 将推送位于cloudfoundry/lattice-app的图像。 You can also read here for more information about Docker Support in CF + Diego. 您还可以在此处阅读有关CF + Diego中的Docker支持的更多信息。

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

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