Reputation: 21
Can someone explain staging in cloud foundry. I have some high level knowledge on this. That CC sends request via cc bridge to diego brain, etc..does staging happens inside a container created temporarily for this purpose ? Are the buildpacks and app files downloaded to containier to create the droplet ?
Upvotes: 0
Views: 1783
Reputation: 62652
In order for Cloud Foundry to run a container with an app in it has to have a droplet created. A droplet is a tar.gz file. There are two ways to create the droplet.
To create a the droplet outside of cloud foundry you write a script to produce to .tar.gz that follows the cf conventions then you use cf push --droplet mydroplet.tgz
to upload a droplet directly to cf and then you can start it and run apps with it. This is very uncommon you should not be doing this.
To create a the droplet inside cloud foundry you execute a cf push
without specifying a droplet. This tells cf that you want it to create the droplet. The process of cf creating a droplet is called staging. Here is what happens during the staging process.
bin/detect
script of buildpack bin/detect
script return 0 then build pack knows how to run. if it returns 1 then the buildpack is skipped and cf tries the next build pack .tar.gz
file Once a droplet is created and stored in the cf blob store cf can start launching containers based on the blob. I recommend you read through the cf docs on bulidpacks at https://docs.cloudfoundry.org/buildpacks/understand-buildpacks.html
Also once an app is running you can do cf ssh
to get into a running container produced by a buildpack through the staging process and look around at the file system layout.
Upvotes: 1