Drivers
build-image
info
- This driver requires the target.app_name field to be set to the Porter release name.
- The source.name field should use the name of the Helm chart that the Porter release is going to use.
This preview environments driver can be used to build a Docker image locally by using some details from the intended Porter release that is being deployed using the built image. The config section, when using this driver, supports the following properties:
build
[Object
, required] - options to build the image, with the following properties:use_pack_cache
[Boolean
, optional] - whether to use the pack cache when building the image, when using thepack
methodmethod
[String
, required] - one ofdocker
,pack
(Cloud Native Buildpacks) orregistry
context
[String
, optional] - the current build context or working directory to use, relative to the root directory. Defaults to the current working directory.dockerfile
[String
, required only whenmethod
isdocker
] - path to the Dockerfile to use, relative to the root directoryimage
[String
, required only whenmethod
isregistry
] - the container image URI to use including the full image path and the tagbuilder
[String
, optional] - the Buildpacks builder to use when using thepack
method. Defaults topaketobuildpacks/builder:full
.buildpacks
[Array of Strings
, optional] - the list of buildpacks to use, when using thepack
methodenv
[Map of String keys to String values
, optional] - the environment variables to use for the build
env_groups
[Array of Objects
, optional] - list of env groups to use to build the app or addon, supporting the following properties:name
[String
, required] - the name of the env groupnamespace
[String
, required] - the namespace to use for the env groupversion
[Integer
, optional] - the version of the env group
values
[Map of String keys to Object values
, optional] - the Helm chart values to use for the app or addon. For a detailed explanation, please read the section on Runtime Configuration.
For example, to build a Docker image locally using the pack
method, you can use the following:
---
resources:
- name: my-image
driver: build-image
source:
name: web
target:
app_name: my-porter-release
config:
build:
method: pack
builder: heroku/builder:20
values:
container:
env:
normal:
FOO: BAR
Outputs
This driver outputs the following identifiers:
registry_url
- the domain part of the image URIimage_repo
- the repository name from the image URIimage_tag
- the image tagimage
- the full URI of the image