Author: Gareth Rushgrove
Build container images using pack and buildpacks.
This extension adds the pack
function, which is used the same way as docker_build
to allow Tilt
to automatically build a container image with a known name. For instance the following example shows
building an image using the default builder and having that image automatically deployed to Kubernetes.
load('ext://pack', 'pack')
pack('example-image')
k8s_yaml('kubernetes.yaml')
k8s_resource('example-deployment', port_forwards=8000)
The pack
function can take a few arguments:
name
: name of the image to be builtpath
: path to application directory, defaults to the current working directorybuilder
: builder image, defaults to gcr.io/paketo-buildpacks/builder:basebuildpacks
: a list of buildpacks to use. (list[str])env_vars
: a list of environment variables. (list[str])
The function also supports all of the properties of custom_build
so
you can ignore files, override the entrypoint or set live updates as usual.
For instance, if you want to use the tiny builder instead of the default Paketo one, you would do the following:
pack(
'example-image',
builder='gcr.io/paketo-buildpacks/builder:tiny'
)
- The
pack
binary must be on your path.