You can manage additional buildpacks in TAS for VMs by using the Cloud Foundry Command Line Interface tool (cf CLI). This page tells you how.
If your app uses a language or framework that the VMware Tanzu Application Service for VMs (TAS for VMs) system buildpacks do not support, you can take one of the following actions:
Write your own buildpack. For more information, see Creating Custom Buildpacks.
Customize an existing buildpack.
Use a Heroku Third-Party Buildpack.
ImportantYou must be a TAS for VMs admin user to run the commands discussed in this section.
To add a buildpack:
Run:
cf create-buildpack BUILDPACK PATH POSITION
Where:
BUILDPACK
specifies the buildpack name.PATH
specifies the location of the buildpack. PATH
can point to a ZIP file, the URL of a ZIP file, or a local directory.POSITION
specifies where to place the buildpack in the detection priority list.For more information, see create-buildpack in the Cloud Foundry CLI Reference Guide.
To confirm that you have successfully added a buildpack, run:
cf buildpacks
To rename a buildpack:
If you use cf CLI v7, run:
cf update-buildpack --rename BUILDPACK-NAME NEW-BUILDPACK-NAME
Where:
BUILDPACK-NAME
is the original buildpack name.NEW-BUILDPACK-NAME
is the new buildpack name.If you use cf CLI v6, run:
cf rename-buildpack BUILDPACK-NAME NEW-BUILDPACK-NAME
Where:
BUILDPACK-NAME
is the original buildpack name.NEW-BUILDPACK-NAME
is the new buildpack name.For more information about renaming buildpacks, see rename-buildpack in the Cloud Foundry CLI Reference Guide.
To update a buildpack, run:
cf update-buildpack BUILDPACK [-p PATH] [-i POSITION] [-s STACK][--enable|--disable] [--lock|--unlock] [--rename NEW_NAME]
Where:
BUILDPACK
is the buildpack name.PATH
is the location of the buildpack.POSITION
is where the buildpack is in the detection priority list.STACK
is the stack that the buildpack uses. ImportantIf you are using cf CLI v6, use the cf rename-buildpack
command instead of the --rename
flag.
For more information about updating buildpacks, see update buildpack in the Cloud Foundry CLI Reference Guide.
To delete a buildpack, run:
cf delete-buildpack BUILDPACK [-s STACK] [-f]
Where:
BUILDPACK
is the buildpack name.STACK
is the stack that the buildpack uses.For more information about deleting buildpacks, see delete-buildpack in the Cloud Foundry CLI Reference Guide.
Every new version of Ops Manager includes an updated buildpack. By default, your deployment applies the most recent buildpack when you upgrade. In some cases, however, you may want to preserve an existing buildpack, rather than upgrade to the latest version. For example, if an app you deploy depends on a specific component in Buildpack A that is not available in Buildpack B, you may want to continue using Buildpack A.
The –lock
flag lets you continue to use your existing buildpack even after you upgrade. Locked buildpacks are not updated when Ops Manager updates. You must manually unlock them to update them.
If you elect to use the –unlock
flag, your deployment will apply the most recent buildpack when you upgrade Ops Manager.
cf update-buildpack BUILDPACK [-p PATH] [-i POSITION] [-s STACK] [--enable|--disable] [--lock|--unlock] [--rename NEW_NAME]
Important If you are using cf CLI v6, the --rename
flag is not supported. Use the cf rename-buildpack
instead.
This feature is also available through the API. See the locked
flag under Update a Buildpack in the Cloud Foundry API documentation.
You can deactivate custom buildpacks using the TAS for VMs tile. In the App Containers pane, deselect the Enable custom buildpacks check box, as shown in the following image.
By default, the cf CLI gives developers the option of using a custom buildpack when they deploy apps to TAS for VMs. To do so, they use the -b
option to provide a custom buildpack URL with the cf push
command. Deselecting the Enable custom buildpacks check box prevents the -b
option from being used with external buildpack URLs.
For more information about custom buildpacks, see Creating custom buildpacks.