Closed ekcasey closed 5 years ago
Suggested change to config.toml:
[[stacks]]
id = <stack-id>
build-image = <build-image>
run-image = <run-image>
run-image-mirrors = [<mirror-image-1>, <mirror-image-2>]
Suggested change to behavior:
When A builder is created with pack create-builder
Then In addition to the run-image
, the run-image-mirrors
are added to the builder metadata
tag
was used instead of image
in config.toml. We should avoid the word "tag," because:
example.com/image@sha256:abc2345
):
ref
would also be acceptable, but we seem to use image
consistently in other places, so I think we should use that here.
I think we should allow users to specify additional run-image locations by adding local configuration for a
run-image
rather than for abuilder
. This will allow users to avoid specifying duplicate configuration for every builder that is based on the same stack. It also expresses the idea that all of the run images should be different locations for the same artifact. Finally It allows us to use the samerun-image
selection logic on bothbuild
andrebase
.set-run-image-mirrors
When I run
pack set-run-image-mirrors <run-image> --mirror=<mirror-image-1> --mirror=<mirror-image-2>
Then I can see the following entry in myconfig.toml
create-builder
Given I have a stack and run image mirrors configured
When I run
pack create-builder -s <stack-id>
Then my builder is generated with the follow metadata label which excludes the mirrorspack build
When I run
pack build <app-image> --run-image=<custom-run-image>
Then<custom-run-image
is used as the base image for<app-image>
. We will not look up mirrorsGiven I have configured run image mirrors
Given my default builder has the following metadata label
{"runImage": { "image": "<run-image>", "mirrors": [<builder-configured-mirror>]} }
When I runpack build <app-image>
Then Then the run image is chosen by finding a image with a registry that matches the app-image preferring a locally configured mirror to a mirror from the builder metadata. (same behavior and order of precedence that we currently have)pack inspect-builder
Given I have configured run image mirrors
Given my builder has the following metadata label
{"runImage": { "image": "<run-image>", "mirrors": [<builder-configured-mirror>]} }
When I runpack inspect builder <builder>
Then the run images section of the output should look like: