Skip to content

Commit a9ab809

Browse files
authored
Merge pull request #3138 from crazy-max/history-copy
history: copy update
2 parents c398e2a + 72fde4c commit a9ab809

28 files changed

+121
-80
lines changed

commands/history/export.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ func exportCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
139139
var options exportOptions
140140

141141
cmd := &cobra.Command{
142-
Use: "export [OPTIONS] [REF]",
143-
Short: "Export a build into Docker Desktop bundle",
142+
Use: "export [OPTIONS] [REF...]",
143+
Short: "Export build records into Docker Desktop bundle",
144144
RunE: func(cmd *cobra.Command, args []string) error {
145145
if options.all && len(args) > 0 {
146146
return errors.New("cannot specify refs when using --all")

commands/history/import.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ func importCmd(dockerCli command.Cli, _ RootOptions) *cobra.Command {
119119
var options importOptions
120120

121121
cmd := &cobra.Command{
122-
Use: "import [OPTIONS] < bundle.dockerbuild",
123-
Short: "Import a build into Docker Desktop",
122+
Use: "import [OPTIONS] -",
123+
Short: "Import build records into Docker Desktop",
124124
Args: cobra.NoArgs,
125125
RunE: func(cmd *cobra.Command, args []string) error {
126126
return runImport(cmd.Context(), dockerCli, options)

commands/history/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ func inspectCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
648648

649649
cmd := &cobra.Command{
650650
Use: "inspect [OPTIONS] [REF]",
651-
Short: "Inspect a build",
651+
Short: "Inspect a build record",
652652
Args: cobra.MaximumNArgs(1),
653653
RunE: func(cmd *cobra.Command, args []string) error {
654654
if len(args) > 0 {

commands/history/inspect_attachment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func attachmentCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
113113

114114
cmd := &cobra.Command{
115115
Use: "attachment [OPTIONS] REF [DIGEST]",
116-
Short: "Inspect a build attachment",
116+
Short: "Inspect a build record attachment",
117117
Args: cobra.RangeArgs(1, 2),
118118
RunE: func(cmd *cobra.Command, args []string) error {
119119
if len(args) > 0 {

commands/history/logs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func logsCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
9898

9999
cmd := &cobra.Command{
100100
Use: "logs [OPTIONS] [REF]",
101-
Short: "Print the logs of a build",
101+
Short: "Print the logs of a build record",
102102
Args: cobra.MaximumNArgs(1),
103103
RunE: func(cmd *cobra.Command, args []string) error {
104104
if len(args) > 0 {

commands/history/ls.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func lsCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
107107
var options lsOptions
108108

109109
cmd := &cobra.Command{
110-
Use: "ls",
110+
Use: "ls [OPTIONS]",
111111
Short: "List build records",
112112
Args: cli.NoArgs,
113113
RunE: func(cmd *cobra.Command, args []string) error {

commands/history/open.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func openCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
5757

5858
cmd := &cobra.Command{
5959
Use: "open [OPTIONS] [REF]",
60-
Short: "Open a build in Docker Desktop",
60+
Short: "Open a build record in Docker Desktop",
6161
Args: cobra.MaximumNArgs(1),
6262
RunE: func(cmd *cobra.Command, args []string) error {
6363
if len(args) > 0 {

commands/history/trace.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func traceCmd(dockerCli command.Cli, rootOpts RootOptions) *cobra.Command {
222222

223223
flags := cmd.Flags()
224224
flags.StringVar(&options.addr, "addr", "127.0.0.1:0", "Address to bind the UI server")
225-
flags.StringVar(&options.compare, "compare", "", "Compare with another build reference")
225+
flags.StringVar(&options.compare, "compare", "", "Compare with another build record")
226226

227227
return cmd
228228
}

commands/imagetools/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func createCmd(dockerCli command.Cli, opts RootOptions) *cobra.Command {
274274
var options createOptions
275275

276276
cmd := &cobra.Command{
277-
Use: "create [OPTIONS] [SOURCE] [SOURCE...]",
277+
Use: "create [OPTIONS] [SOURCE...]",
278278
Short: "Create a new image based on source images",
279279
RunE: func(cmd *cobra.Command, args []string) error {
280280
options.builder = *opts.Builder

commands/rm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func rmCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command {
9999
var options rmOptions
100100

101101
cmd := &cobra.Command{
102-
Use: "rm [OPTIONS] [NAME] [NAME...]",
102+
Use: "rm [OPTIONS] [NAME...]",
103103
Short: "Remove one or more builder instances",
104104
RunE: func(cmd *cobra.Command, args []string) error {
105105
options.builders = []string{rootOpts.builder}

docs/reference/buildx_dial-stdio.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# docker buildx dial-stdio
22

3+
```text
4+
docker buildx dial-stdio [OPTIONS] < in.fifo > out.fifo &
5+
```
6+
37
<!---MARKER_GEN_START-->
48
Proxy current stdio streams to builder instance
59

@@ -17,13 +21,15 @@ Proxy current stdio streams to builder instance
1721

1822
## Description
1923

20-
dial-stdio uses the stdin and stdout streams of the command to proxy to the configured builder instance.
21-
It is not intended to be used by humans, but rather by other tools that want to interact with the builder instance via BuildKit API.
24+
dial-stdio uses the stdin and stdout streams of the command to proxy to the
25+
configured builder instance. It is not intended to be used by humans, but
26+
rather by other tools that want to interact with the builder instance via
27+
BuildKit API.
2228

2329
## Examples
2430

2531
Example go program that uses the dial-stdio command wire up a buildkit client.
26-
This is for example use only and may not be suitable for production use.
32+
This is, for example, use only and may not be suitable for production use.
2733

2834
```go
2935
client.New(ctx, "", client.WithContextDialer(func(context.Context, string) (net.Conn, error) {
@@ -45,4 +51,4 @@ client.New(ctx, "", client.WithContextDialer(func(context.Context, string) (net.
4551

4652
return c2
4753
}))
48-
```
54+
```

docs/reference/buildx_du.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# buildx du
22

33
```text
4-
docker buildx du
4+
docker buildx du [OPTIONS]
55
```
66

77
<!---MARKER_GEN_START-->

docs/reference/buildx_history.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# docker buildx history
22

3+
```text
4+
docker buildx history [OPTIONS] COMMAND
5+
```
6+
37
<!---MARKER_GEN_START-->
48
Commands to work on build records
59

610
### Subcommands
711

8-
| Name | Description |
9-
|:---------------------------------------|:-----------------------------------------------|
10-
| [`export`](buildx_history_export.md) | Export a build into Docker Desktop bundle |
11-
| [`import`](buildx_history_import.md) | Import a build into Docker Desktop |
12-
| [`inspect`](buildx_history_inspect.md) | Inspect a build |
13-
| [`logs`](buildx_history_logs.md) | Print the logs of a build |
14-
| [`ls`](buildx_history_ls.md) | List build records |
15-
| [`open`](buildx_history_open.md) | Open a build in Docker Desktop |
16-
| [`rm`](buildx_history_rm.md) | Remove build records |
17-
| [`trace`](buildx_history_trace.md) | Show the OpenTelemetry trace of a build record |
12+
| Name | Description |
13+
|:---------------------------------------|:------------------------------------------------|
14+
| [`export`](buildx_history_export.md) | Export build records into Docker Desktop bundle |
15+
| [`import`](buildx_history_import.md) | Import build records into Docker Desktop |
16+
| [`inspect`](buildx_history_inspect.md) | Inspect a build record |
17+
| [`logs`](buildx_history_logs.md) | Print the logs of a build record |
18+
| [`ls`](buildx_history_ls.md) | List build records |
19+
| [`open`](buildx_history_open.md) | Open a build record in Docker Desktop |
20+
| [`rm`](buildx_history_rm.md) | Remove build records |
21+
| [`trace`](buildx_history_trace.md) | Show the OpenTelemetry trace of a build record |
1822

1923

2024
### Options
+25-27
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# docker buildx history export
22

33
<!---MARKER_GEN_START-->
4-
Export a build into Docker Desktop bundle
4+
Export build records into Docker Desktop bundle
55

66
### Options
77

@@ -23,59 +23,57 @@ Desktop or shared across environments.
2323

2424
## Examples
2525

26-
### <a name="output"></a> Export a single build to a custom file (--output)
26+
### <a name="all"></a> Export all build records to a file (--all)
27+
28+
Use the `--all` flag and redirect the output:
2729

2830
```console
29-
docker buildx history export qu2gsuo8ejqrwdfii23xkkckt --output mybuild.dockerbuild
31+
docker buildx history export --all > all-builds.dockerbuild
3032
```
3133

32-
You can find build IDs by running:
34+
Or use the `--output` flag:
3335

3436
```console
35-
docker buildx history ls
37+
docker buildx history export --all -o all-builds.dockerbuild
3638
```
3739

38-
### <a name="o"></a> Export multiple builds to individual `.dockerbuild` files (-o)
39-
40-
To export two builds to separate files:
40+
### <a name="builder"></a> Use a specific builder instance (--builder)
4141

4242
```console
43-
# Using build IDs
44-
docker buildx history export qu2gsuo8ejqrwdfii23xkkckt qsiifiuf1ad9pa9qvppc0z1l3 -o multi.dockerbuild
45-
46-
# Or using relative offsets
47-
docker buildx history export ^1 ^2 -o multi.dockerbuild
43+
docker buildx history export --builder builder0 ^1 -o builder0-build.dockerbuild
4844
```
4945

50-
Or use shell redirection:
46+
### <a name="debug"></a> Enable debug logging (--debug)
5147

5248
```console
53-
docker buildx history export ^1 > mybuild.dockerbuild
54-
docker buildx history export ^2 > backend-build.dockerbuild
49+
docker buildx history export --debug qu2gsuo8ejqrwdfii23xkkckt -o debug-build.dockerbuild
5550
```
5651

57-
### <a name="all"></a> Export all build records to a file (--all)
58-
59-
Use the `--all` flag and redirect the output:
52+
### <a name="output"></a> Export a single build to a custom file (--output)
6053

6154
```console
62-
docker buildx history export --all > all-builds.dockerbuild
55+
docker buildx history export qu2gsuo8ejqrwdfii23xkkckt --output mybuild.dockerbuild
6356
```
6457

65-
Or use the `--output` flag:
58+
You can find build IDs by running:
6659

6760
```console
68-
docker buildx history export --all -o all-builds.dockerbuild
61+
docker buildx history ls
6962
```
7063

71-
### <a name="builder"></a> Use a specific builder instance (--builder)
64+
To export two builds to separate files:
7265

7366
```console
74-
docker buildx history export --builder builder0 ^1 -o builder0-build.dockerbuild
67+
# Using build IDs
68+
docker buildx history export qu2gsuo8ejqrwdfii23xkkckt qsiifiuf1ad9pa9qvppc0z1l3 -o multi.dockerbuild
69+
70+
# Or using relative offsets
71+
docker buildx history export ^1 ^2 -o multi.dockerbuild
7572
```
7673

77-
### <a name="debug"></a> Enable debug logging (--debug)
74+
Or use shell redirection:
7875

7976
```console
80-
docker buildx history export --debug qu2gsuo8ejqrwdfii23xkkckt -o debug-build.dockerbuild
81-
```
77+
docker buildx history export ^1 > mybuild.dockerbuild
78+
docker buildx history export ^2 > backend-build.dockerbuild
79+
```

docs/reference/buildx_history_import.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# docker buildx history import
22

3+
```text
4+
docker buildx history import [OPTIONS] -
5+
```
6+
37
<!---MARKER_GEN_START-->
4-
Import a build into Docker Desktop
8+
Import build records into Docker Desktop
59

610
### Options
711

docs/reference/buildx_history_inspect.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# docker buildx history inspect
22

3+
```text
4+
docker buildx history inspect [OPTIONS] [REF|COMMAND]
5+
```
6+
37
<!---MARKER_GEN_START-->
4-
Inspect a build
8+
Inspect a build record
59

610
### Subcommands
711

8-
| Name | Description |
9-
|:-----------------------------------------------------|:---------------------------|
10-
| [`attachment`](buildx_history_inspect_attachment.md) | Inspect a build attachment |
12+
| Name | Description |
13+
|:-----------------------------------------------------|:----------------------------------|
14+
| [`attachment`](buildx_history_inspect_attachment.md) | Inspect a build record attachment |
1115

1216

1317
### Options
@@ -74,7 +78,7 @@ docker buildx history inspect ^1
7478
The formatting options (`--format`) pretty-prints the output to `pretty` (default),
7579
`json` or using a Go template.
7680

77-
**Pretty output**
81+
#### Pretty output
7882

7983
```console
8084
$ docker buildx history inspect
@@ -105,7 +109,8 @@ sha256:217329d2af959d4f02e3a96dcbe62bf100cab1feb8006a047ddfe51a5397f7e3
105109

106110
Print build logs: docker buildx history logs g9808bwrjrlkbhdamxklx660b
107111
```
108-
**JSON output**
112+
113+
#### JSON output
109114

110115
```console
111116
$ docker buildx history inspect --format json
@@ -160,7 +165,7 @@ $ docker buildx history inspect --format json
160165
}
161166
```
162167

163-
**Go template output**
168+
#### Go template output
164169

165170
```console
166171
$ docker buildx history inspect --format "{{.Name}}: {{.VCSRepository}} ({{.VCSRevision}})"

docs/reference/buildx_history_inspect_attachment.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# docker buildx history inspect attachment
22

3+
```text
4+
docker buildx history inspect attachment [OPTIONS] REF [DIGEST]
5+
```
6+
37
<!---MARKER_GEN_START-->
4-
Inspect a build attachment
8+
Inspect a build record attachment
59

610
### Options
711

docs/reference/buildx_history_logs.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# docker buildx history logs
22

3+
```text
4+
docker buildx history logs [OPTIONS] [REF]
5+
```
6+
37
<!---MARKER_GEN_START-->
4-
Print the logs of a build
8+
Print the logs of a build record
59

610
### Options
711

docs/reference/buildx_history_ls.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# docker buildx history ls
22

3+
```text
4+
docker buildx history ls [OPTIONS]
5+
```
6+
37
<!---MARKER_GEN_START-->
48
List build records
59

@@ -45,10 +49,10 @@ docker buildx history ls --filter status=error
4549

4650
You can filter the list using the `--filter` flag. Supported filters include:
4751

48-
| Filter | Supported comparisons | Example |
49-
|:-------|:----------------------|:--------|
50-
| `ref`, `repository`, `status` | Support `=` and `!=` comparisons | `--filter status!=success` |
51-
| `startedAt`, `completedAt`, `duration` | Support `<` and `>` comparisons with time values | `--filter duration>30s` |
52+
| Filter | Supported comparisons | Example |
53+
|:---------------------------------------|:-------------------------------------------------|:---------------------------|
54+
| `ref`, `repository`, `status` | Support `=` and `!=` comparisons | `--filter status!=success` |
55+
| `startedAt`, `completedAt`, `duration` | Support `<` and `>` comparisons with time values | `--filter duration>30s` |
5256

5357
You can combine multiple filters by repeating the `--filter` flag:
5458

@@ -70,7 +74,7 @@ docker buildx history ls --no-trunc
7074

7175
### <a name="format"></a> Format output (--format)
7276

73-
**JSON output**
77+
#### JSON output
7478

7579
```console
7680
$ docker buildx history ls --format json
@@ -92,7 +96,7 @@ $ docker buildx history ls --format json
9296
]
9397
```
9498

95-
**Go template output**
99+
#### Go template output
96100

97101
```console
98102
$ docker buildx history ls --format '{{.Name}} - {{.Duration}}'

0 commit comments

Comments
 (0)