Skip to content

Commit 4c1e7b2

Browse files
authored
Merge pull request #3258 from crazy-max/docs-fix-history-attachment
docs: fix history inspect attachment examples
2 parents e9b6a01 + ec45eb6 commit 4c1e7b2

File tree

1 file changed

+143
-31
lines changed

1 file changed

+143
-31
lines changed

docs/reference/buildx_history_inspect_attachment.md

Lines changed: 143 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Inspect a build record attachment
99

1010
### Options
1111

12-
| Name | Type | Default | Description |
13-
|:------------------|:---------|:--------|:-----------------------------------------|
14-
| `--builder` | `string` | | Override the configured builder instance |
15-
| `-D`, `--debug` | `bool` | | Enable debug logging |
16-
| `--platform` | `string` | | Platform of attachment |
17-
| [`--type`](#type) | `string` | | Type of attachment |
12+
| Name | Type | Default | Description |
13+
|:--------------------------|:---------|:--------|:-----------------------------------------|
14+
| `--builder` | `string` | | Override the configured builder instance |
15+
| `-D`, `--debug` | `bool` | | Enable debug logging |
16+
| [`--platform`](#platform) | `string` | | Platform of attachment |
17+
| [`--type`](#type) | `string` | | Type of attachment |
1818

1919

2020
<!---MARKER_GEN_END-->
@@ -27,48 +27,160 @@ platform-specific.
2727

2828
## Examples
2929

30-
### <a name="type"></a> Inspect a provenance attachment from a build (--type)
30+
### <a name="platform"></a> Inspect an attachment by platform (--platform)
3131

32-
Supported types include `provenance` and `sbom`.
32+
```console
33+
$ docker buildx history inspect attachment --platform linux/amd64
34+
{
35+
"schemaVersion": 2,
36+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
37+
"config": {
38+
"mediaType": "application/vnd.oci.image.config.v1+json",
39+
"digest": "sha256:814e63f06465bc78123775714e4df1ebdda37e6403e0b4f481df74947c047163",
40+
"size": 600
41+
},
42+
"layers": [
43+
{
44+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
45+
"digest": "sha256:36537f3920ae948ce3e12b4ae34c21190280e6e7d58eeabde0dff3fdfb43b6b0",
46+
"size": 21664137
47+
}
48+
]
49+
}
50+
```
51+
52+
### <a name="type"></a> Inspect an attachment by type (--type)
53+
54+
Supported types include:
55+
* `index`
56+
* `manifest`
57+
* `image`
58+
* `provenance`
59+
* `sbom`
60+
61+
#### Index
3362

3463
```console
35-
$ docker buildx history inspect attachment qu2gsuo8ejqrwdfii23xkkckt --type provenance
64+
$ docker buildx history inspect attachment --type index
3665
{
37-
"_type": "https://slsa.dev/provenance/v0.2",
38-
"buildDefinition": {
39-
"buildType": "https://build.docker.com/BuildKit@v1",
40-
"externalParameters": {
41-
"target": "app",
42-
"platforms": ["linux/amd64"]
66+
"schemaVersion": 2,
67+
"mediaType": "application/vnd.oci.image.index.v1+json",
68+
"manifests": [
69+
{
70+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
71+
"digest": "sha256:a194e24f47dc6d0e65992c09577b9bc4e7bd0cd5cc4f81e7738918f868aa397b",
72+
"size": 481,
73+
"platform": {
74+
"architecture": "amd64",
75+
"os": "linux"
76+
}
77+
},
78+
{
79+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
80+
"digest": "sha256:49e40223d6a96ea0667a12737fd3dde004cf217eb48cb28c9191288cd44c6ace",
81+
"size": 839,
82+
"annotations": {
83+
"vnd.docker.reference.digest": "sha256:a194e24f47dc6d0e65992c09577b9bc4e7bd0cd5cc4f81e7738918f868aa397b",
84+
"vnd.docker.reference.type": "attestation-manifest"
85+
},
86+
"platform": {
87+
"architecture": "unknown",
88+
"os": "unknown"
89+
}
4390
}
44-
},
45-
"runDetails": {
46-
"builder": "docker",
47-
48-
}
91+
]
4992
}
5093
```
5194

52-
### Inspect a SBOM for linux/amd64
95+
#### Manifest
5396

5497
```console
55-
$ docker buildx history inspect attachment ^0 \
56-
--type sbom \
57-
--platform linux/amd64
98+
$ docker buildx history inspect attachment --type manifest
5899
{
59-
"bomFormat": "CycloneDX",
60-
"specVersion": "1.5",
61-
"version": 1,
62-
"components": [
100+
"schemaVersion": 2,
101+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
102+
"config": {
103+
"mediaType": "application/vnd.oci.image.config.v1+json",
104+
"digest": "sha256:814e63f06465bc78123775714e4df1ebdda37e6403e0b4f481df74947c047163",
105+
"size": 600
106+
},
107+
"layers": [
63108
{
64-
"type": "library",
65-
"name": "alpine",
66-
"version": "3.18.2"
109+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
110+
"digest": "sha256:36537f3920ae948ce3e12b4ae34c21190280e6e7d58eeabde0dff3fdfb43b6b0",
111+
"size": 21664137
67112
}
68113
]
69114
}
70115
```
71116

117+
#### Provenance
118+
119+
```console
120+
$ docker buildx history inspect attachment --type provenance
121+
{
122+
"builder": {
123+
"id": ""
124+
},
125+
"buildType": "https://mobyproject.org/buildkit@v1",
126+
"materials": [
127+
{
128+
"uri": "pkg:docker/docker/dockerfile@1",
129+
"digest": {
130+
"sha256": "9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc"
131+
}
132+
},
133+
{
134+
"uri": "pkg:docker/[email protected]?platform=linux%2Farm64",
135+
"digest": {
136+
"sha256": "a9b24b67dc83b3383d22a14941c2b2b2ca6a103d805cac6820fd1355943beaf1"
137+
}
138+
}
139+
],
140+
"invocation": {
141+
"configSource": {
142+
"entryPoint": "Dockerfile"
143+
},
144+
"parameters": {
145+
"frontend": "gateway.v0",
146+
"args": {
147+
"cmdline": "docker/dockerfile:1",
148+
"source": "docker/dockerfile:1",
149+
"target": "binaries"
150+
},
151+
"locals": [
152+
{
153+
"name": "context"
154+
},
155+
{
156+
"name": "dockerfile"
157+
}
158+
]
159+
},
160+
"environment": {
161+
"platform": "linux/arm64"
162+
}
163+
},
164+
"metadata": {
165+
"buildInvocationID": "c4a87v0sxhliuewig10gnsb6v",
166+
"buildStartedOn": "2022-12-16T08:26:28.651359794Z",
167+
"buildFinishedOn": "2022-12-16T08:26:29.625483253Z",
168+
"reproducible": false,
169+
"completeness": {
170+
"parameters": true,
171+
"environment": true,
172+
"materials": false
173+
},
174+
"https://mobyproject.org/buildkit@v1#metadata": {
175+
"vcs": {
176+
"revision": "a9ba846486420e07d30db1107411ac3697ecab68",
177+
"source": "[email protected]:<org>/<repo>.git"
178+
}
179+
}
180+
}
181+
}
182+
```
183+
72184
### Inspect an attachment by digest
73185

74186
You can inspect an attachment directly using its digset, which you can get from

0 commit comments

Comments
 (0)