Skip to content

Commit

Permalink
Added details on image resolution w/ mirros
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Brown <[email protected]>
  • Loading branch information
jabrown85 committed Jul 5, 2023
1 parent e21f678 commit 54db935
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions text/0000-private-mirrors.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ When `lifecycle` requests an image during any phase (`analyze`, `restore`, `expo

If the private registry requires authentication, authentication to the registry will be handled by the existing `CNB_REGISTRY_AUTH` value. If the private registry does not require authentication, no additional configuration is required.

If registry mirrors are configured for specific images in configuration (e.g. `stack.toml` or `run.toml`), the `CNB_REGISTRY_MIRRORS` will be processed with each registry attempt. For example, the following `stack.toml` configures mirrors for `public/stack:run-image`:

```toml
[run-image]
image = "public/stack:run-image"
mirrors = ["quay.io/public/stack:run-image"]
```

If `CNB_REGISTRY_MIRRORS` has the value of:

```
docker.io=https://docker.mirror.example.com;quay.io=https://quay.mirror.example.com
```

When `lifecycle` attempts to resolve the `public/stack:run-image` image, `lifecycle` will attempt to fetch the image from `docker.mirror.example.com/public/stack:run-image`. If the [Run Image Resolution](https://github.com/buildpacks/spec/blob/main/platform.md#run-image-resolution) resulted in `quay.io/public/stack:run-image` being chosen, `lifecycle` will attempt to fetch the image from `quay.mirror.example.com/public/stack:run-image` instead. This new processing happens AFTER the [Run Image Resolution](https://github.com/buildpacks/spec/blob/main/platform.md#run-image-resolution) has executed. The run image selection will NOT take `CNB_REGISTRY_MIRRORS` into account, but the final image resolution will. Think of `CNB_REGISTRY_MIRRORS` as a just-in-time override of the final image resolution.

# Migration
[migration]: #migration

Expand Down

0 comments on commit 54db935

Please sign in to comment.