'how to check running application's buildpack In cloudfoundry
How to check running application's buildpack In cloudfoundry?
I have many buildpacks deployed, is it possible to check used buildpacks on running application?
Solution 1:[1]
Two|Three Stepped Process worked for Cloud Foundry api version: 2.141.0:
- Retrieve the GUID of the application using
cf app <app_name> --guid- API Doc - Get App summary using above GUID
cf curl /v2/apps/:APP-GUID/summary- API Doc - Search for
"buildpack"in result, should be there - something like this
If "buildpack" not found then follow instructions post from @Smile - Adding here for easier read.
- Search for
"detected_buildpack_guid"in above result, e.g.
- Retrieve Buildpack information using above GUID
cf curl /v2/buildpacks/:guid- API Doc, then search forfilenamein results, e.g.,
Note: Make sure to login into CloudFoundry before executing this commands.
Solution 2:[2]
You can do it multiple ways..
You can install buildpack-usage cf cli plugin. You can find it here or here
The other option is to do
$> cf curl "/v2/apps"
Check out Cloud Foundry API
Give it a try. Let me know if you have any questions.
Solution 3:[3]
In addition to Abhijeet's answer, in case you get buildpack attribute as null or empty, you can get the buildpack guid from detected_buildpack_guid attribute and call buildback API like
cf curl /v2/buildpacks/:BUILDPACK-GUID
Solution 4:[4]
This can be fetched from the below V3 APIs.
Get the list of Application GUIDs:
cf curl '/v3/apps'Get the relevant buildpacks and its version:
cf curl /v3/apps/AppGUID/droplets/current
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | K.AJ |
| Solution 3 | Smile |
| Solution 4 | dbc |
