Chapter 9. Buildpacks and Docker

As we explored in Chapter 8, apps1 that have been deployed to Cloud Foundry run as containerized processes. Cloud Foundry supports running OCI–compatible container images such as Docker as first-class citizens. It also supports running a standalone app artifact (e.g., .jar file or Ruby app) deployed “as is,” containerizing apps on the user’s behalf.

Users can deploy a containerized image by using the cf push command. This command, along with additional arguments, is used for deploying both standalone apps and OCI-compatible container images.

When deploying just a standalone app artifact, Cloud Foundry stages your pushed app by composing a binary artifact known as a droplet. A droplet is an encapsulated version of your app along with all of the required runtime components and app dependencies. Cloud Foundry composes this droplet via its buildpack mechanism. The resulting droplet, combined with a stack (filesystem), is equivalent to a container image. Cloud Foundry runs this droplet in the same way as any other OCI-compatible container image: as an isolated containerized process.

When you push an app, Cloud Foundry automatically detects how to run that app and then invokes the use of Application Life-Cycle Binaries (ALB). The correct set of ALBs will be installed on the Cell (the Diego machine) where the app needs to run. For example, if a Docker image is pushed, the Docker ALBs will be used. If your app requires further compilation via a buildpack, ...

Get Cloud Foundry: The Definitive Guide, 1st Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.