Fly Buildpacks
How to build flyio/builder
TL;DR
make build-bionic # Make everything locally make linux-deploy # Push images out to public make clean-linux # Clean out local images
Start here:
To get up and running, install pack and run make build-linux or make build-windows, depending on your choice of target OS.
Follow the README.md docs at the root directory of each component to choose your next step. We recommend starting to play with building apps.
We'll need that later
The Stack
We need a base stack with curl and unzip.
stacks/build-stack.sh stacks/bionic
(prefixes are already hard coded in) (If there's an error regarding a lack of realpath, brew install coreutils)
STACK BUILT!
Stack ID: io.fly.stacks.bionic
Images:
flyio/buildpack-stack-base:bionic
flyio/buildpack-stack-build:bionic
flyio/buildpack-stack-run:bionic
Push the images to public
docker push flyio/buildpack-stack-base:bionic
docker push flyio/buildpack-stack-run:bionic
docker push flyio/buildpack-stack-base:bionic
Package the buildpacks
At the repo root, run
pack package-buildpack flyio/deno-cnb --package-config packages/deno-cnb/package.toml --publish
This is now ready to be merged with the stack to make a builder
Creating the Builder
At the repo root, run
pack create-builder flyio/builder --builder-config builders/bionic/builder.toml --publish
--publish is used to make the image public
Test Builder
cd apps/deno pack build test-deno-app --builder flyio/builder docker run -it -p 8080:8080 test-deno-app
Run with fly
flyctl apps create --builder flyio/builder
Deno permissions
A .permissons file will be picked up and used as the permissions section of the deno command.
e.g. on the example Deno app -
--allow-env --allow-net
This setting defaults to the permissive -A if no .permissions is present.
Quick Reference
- Create a Buildpack Tutorial → Tutorial to get you started on your first Cloud Native Buildpack
- Buildpacks.io → Cloud Native Buildpack website
- Pack – Buildpack CLI → CLI used to consume the builder, along with source code, and construct an OCI image
- CNB Tutorial → Tutorial to get you started using
pack, abuilder, and your application to create a working OCI image - Buildpack & Platform Specification → Detailed definition of the interaction between a platform, a lifecycle, Cloud Native Buildpacks, and an application
Development
Prerequisites
This repo was based on the buildpacks.io samples repo.