Summary

Buildpacks is a program that turns source code into the runnable container image; similar to `docker build` command that uses Dockerfile

Usually, Buildpacks encapsulate a single language ecosystem toolchain. There are buildpacks for Ruby, Go, NodeJs, , Python, and more.

docker build vs pack

How it works?

These buildpacks can be grouped together into collections called a builder. In a builder, each buildpack will inspect the application source code and detect if it should participate in the build process. For example, a Go buildpack would look for files ending in .go, while a Ruby buildpack would look for *.rb files. *Once a buildpack (or set of buildpacks) has matched, it moves on to the build step. That’s when the buildpack does its job. It might add a layer to the container image that contains a dependency, like the Go distribution, or it runs a command, like go build. ref

Using Buildpacks with ATTACH

repo-root
|
|
-- Procfile # contains command that starts the service inside container
-- runtime.txt # contains python version
-- requirements.txt
--demo-django-project
---app
---demo-django-project

Used by

  1. Heroku
  2. Cloud Foundary