Punter Vicky
Punter Vicky

Reputation: 17042

Running docker image on pivotal cloud foundry

I have an application that is running in a docker container. Is it possible to deploy this docker container containing the application in Cloud Foundry without making any changes to the application or container itself?

Upvotes: 1

Views: 2492

Answers (2)

Amit Kumar Gupta
Amit Kumar Gupta

Reputation: 18607

To answer your specific question about whether you will need to make changes to your Docker image or not, here's the relevant info.

  • 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.
  • 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.
  • 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.

(Info filtered from official CF docs site and Diego design notes)

Upvotes: 3

Ali Dehghani
Ali Dehghani

Reputation: 48193

As discussed on Cloud Foundry's documentation, you should first enable the diego_docker feature flag with the following command:

cf enable-feature-flag diego_docker

Then use the cf push in order to push your docker image. 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. For example, running:

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

will push the image located at cloudfoundry/lattice-app. You can also read here for more information about Docker Support in CF + Diego.

Upvotes: 1

Related Questions