You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/buildx_history_logs.md
+37-9
Original file line number
Diff line number
Diff line change
@@ -16,32 +16,60 @@ Print the logs of a build
16
16
17
17
## Description
18
18
19
-
Print the logs for a completed build. The output appears in the same format as `--progress=plain`, showing the full logs for each step without multiplexing.
19
+
Print the logs for a completed build. The output appears in the same format as
20
+
`--progress=plain`, showing the full logs for each step.
20
21
21
22
By default, this shows logs for the most recent build on the current builder.
22
23
24
+
You can also specify an earlier build using an offset. For example:
25
+
26
+
-`^1` shows logs for the build before the most recent
27
+
-`^2` shows logs for the build two steps back
28
+
23
29
## Examples
24
30
25
-
### Print logs for the most recent build
31
+
### <aname="print-logs-recent-build"></a> Print logs for the most recent build
26
32
27
33
```console
28
-
docker buildx history logs
34
+
$ docker buildx history logs
35
+
#1 [internal] load build definition from Dockerfile
36
+
#1 transferring dockerfile: 31B done
37
+
#1 DONE 0.0s
38
+
#2 [internal] load .dockerignore
39
+
#2 transferring context: 2B done
40
+
#2 DONE 0.0s
41
+
...
29
42
```
30
43
31
-
### Print logs for a specific build
44
+
By default, this shows logs for the most recent build on the current builder.
45
+
46
+
### <aname="print-logs-specific-build"></a> Print logs for a specific build
47
+
48
+
To print logs for a specific build, use a build ID or offset:
32
49
33
50
```console
34
-
docker buildx history logs mybuild
51
+
# Using a build ID
52
+
docker buildx history logs qu2gsuo8ejqrwdfii23xkkckt
53
+
54
+
# Or using a relative offset
55
+
docker buildx history logs ^1
35
56
```
36
57
37
-
### Print logs in JSON format
58
+
### <aname="print-logs-json"></a> Print logs in JSON format
38
59
39
60
```console
40
-
docker buildx history logs mybuild --progress rawjson
61
+
$ docker buildx history logs ^1 --progress rawjson
62
+
{"id":"buildx_step_1","status":"START","timestamp":"2024-05-01T12:34:56.789Z","detail":"[internal] load build definition from Dockerfile"}
0 commit comments