-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[0.11] buildinfo: mark as deprecated #3614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| # Build information | ||
|
|
||
| > **Warning** | ||
| > | ||
| > Build information is deprecated and will be removed in the next release. See | ||
| > the [Deprecated features page](https://github.com/moby/buildkit/blob/master/docs/deprecated.md) | ||
| > for status and alternative recommendation about this feature. | ||
|
|
||
| Build information structures are generated with build metadata that allows you | ||
| to see all the sources (images, git repositories) that were used by the build | ||
| with their exact versions and also the configuration that was passed to the | ||
| build. This information is also embedded into the image configuration if one | ||
| is generated. | ||
|
|
||
| ## Build dependencies | ||
|
|
||
| Build dependencies are generated when your image has been built. These | ||
| dependencies include versions of used images, git repositories and HTTP URLs | ||
| used by LLB `Source` operation as well as build request attributes. | ||
|
|
||
| The structure is base64 encoded and has the following format when decoded: | ||
|
|
||
| ```json | ||
| { | ||
| "frontend": "dockerfile.v0", | ||
| "attrs": { | ||
| "build-arg:foo": "bar", | ||
| "context": "https://github.com/crazy-max/buildkit-buildsources-test.git#master", | ||
| "filename": "Dockerfile", | ||
| "platform": "linux/amd64,linux/arm64", | ||
| "source": "crazymax/dockerfile:master" | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "type": "docker-image", | ||
| "ref": "docker.io/docker/buildx-bin:0.6.1@sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0", | ||
| "pin": "sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0" | ||
| }, | ||
| { | ||
| "type": "docker-image", | ||
| "ref": "docker.io/library/alpine:3.13", | ||
| "pin": "sha256:1d30d1ba3cb90962067e9b29491fbd56997979d54376f23f01448b5c5cd8b462" | ||
| }, | ||
| { | ||
| "type": "git", | ||
| "ref": "https://github.com/crazy-max/buildkit-buildsources-test.git#master", | ||
| "pin": "259a5aa5aa5bb3562d12cc631fe399f4788642c1" | ||
| }, | ||
| { | ||
| "type": "http", | ||
| "ref": "https://raw.githubusercontent.com/moby/moby/v20.10.21/README.md", | ||
| "pin": "sha256:419455202b0ef97e480d7f8199b26a721a417818bc0e2d106975f74323f25e6c" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| * `frontend` defines the frontend used to build. | ||
| * `attrs` defines build request attributes. | ||
| * `sources` defines build sources. | ||
| * `type` defines the source type (`docker-image`, `git` or `http`). | ||
| * `ref` is the reference of the source. | ||
| * `pin` is the source digest. | ||
| * `deps` defines build dependencies of input contexts. | ||
|
|
||
| ### Image config | ||
|
|
||
| A new field similar to the one for inline cache has been added to the image | ||
| configuration to embed build dependencies: | ||
|
|
||
| ```json | ||
| { | ||
| "moby.buildkit.buildinfo.v0": "<base64>" | ||
| } | ||
| ``` | ||
|
|
||
| By default, the build dependencies are inlined in the image configuration. You | ||
| can disable this behavior with the [`buildinfo` attribute](../README.md#imageregistry). | ||
|
|
||
| ### Exporter response (metadata) | ||
|
|
||
| The solver response (`ExporterResponse`) also contains a new key | ||
| `containerimage.buildinfo` with the same structure as image config encoded in | ||
| base64: | ||
|
|
||
| ```json | ||
| { | ||
| "ExporterResponse": { | ||
| "containerimage.buildinfo": "<base64>", | ||
| "containerimage.digest": "sha256:..." | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| If multi-platforms are specified, they will be suffixed with the corresponding | ||
| platform: | ||
|
|
||
| ```json | ||
| { | ||
| "ExporterResponse": { | ||
| "containerimage.buildinfo/linux/amd64": "<base64>", | ||
| "containerimage.buildinfo/linux/arm64": "<base64>", | ||
| "containerimage.digest": "sha256:..." | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Metadata JSON output | ||
|
|
||
| If you're using the `--metadata-file` flag with [`buildctl`](../README.md#metadata), | ||
| [`buildx build`](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md) | ||
| or [`buildx bake`](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md): | ||
|
|
||
| ```shell | ||
| jq '.' metadata.json | ||
| ``` | ||
| ```json | ||
| { | ||
| "containerimage.buildinfo": { | ||
| "frontend": "dockerfile.v0", | ||
| "attrs": { | ||
| "context": "https://github.com/crazy-max/buildkit-buildsources-test.git#master", | ||
| "filename": "Dockerfile", | ||
| "source": "docker/dockerfile:master" | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "type": "docker-image", | ||
| "ref": "docker.io/docker/buildx-bin:0.6.1@sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0", | ||
| "pin": "sha256:a652ced4a4141977c7daaed0a074dcd9844a78d7d2615465b12f433ae6dd29f0" | ||
| }, | ||
| { | ||
| "type": "docker-image", | ||
| "ref": "docker.io/library/alpine:3.13", | ||
| "pin": "sha256:026f721af4cf2843e07bba648e158fb35ecc876d822130633cc49f707f0fc88c" | ||
| } | ||
| ] | ||
| }, | ||
| "containerimage.digest": "sha256:..." | ||
| } | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.