@@ -32,11 +32,13 @@ import (
3232)
3333
3434var (
35- dockerCmd * cobra.Command
36- buildxCmd * cobra.Command
37- buildxBuildCmd * cobra.Command
38- buildxInstallCmd * cobra.Command
39- buildxStopCmd * cobra.Command
35+ dockerCmd * cobra.Command
36+ attachCmd * cobra.Command
37+ buildxCmd * cobra.Command
38+ buildxBuildCmd * cobra.Command
39+ buildxDialStdioCmd * cobra.Command
40+ buildxInstallCmd * cobra.Command
41+ buildxStopCmd * cobra.Command
4042)
4143
4244//nolint:errcheck
@@ -51,6 +53,22 @@ func setup() {
5153 Version : "20.10.8" ,
5254 DisableFlagsInUseLine : true ,
5355 }
56+
57+ attachCmd = & cobra.Command {
58+ Use : "attach [OPTIONS] CONTAINER" ,
59+ Short : "Attach local standard input, output, and error streams to a running container" ,
60+ Annotations : map [string ]string {
61+ "aliases" : "docker container attach, docker attach" ,
62+ },
63+ Run : func (cmd * cobra.Command , args []string ) {},
64+ }
65+
66+ attachFlags := attachCmd .Flags ()
67+ attachFlags .Bool ("no-stdin" , false , "Do not attach STDIN" )
68+ attachFlags .Bool ("sig-proxy" , true , "Proxy all received signals to the process" )
69+ attachFlags .String ("detach-keys" , "" , "Override the key sequence for detaching a container" )
70+ dockerCmd .AddCommand (attachCmd )
71+
5472 buildxCmd = & cobra.Command {
5573 Use : "buildx" ,
5674 Short : "Docker Buildx" ,
@@ -68,6 +86,12 @@ func setup() {
6886 "aliases" : "docker image build, docker buildx build, docker buildx b, docker build" ,
6987 },
7088 }
89+ buildxDialStdioCmd = & cobra.Command {
90+ Use : "dial-stdio" ,
91+ Short : "Proxy current stdio streams to builder instance" ,
92+ Args : cobra .NoArgs ,
93+ Run : func (cmd * cobra.Command , args []string ) {},
94+ }
7195 buildxInstallCmd = & cobra.Command {
7296 Use : "install" ,
7397 Short : "Install buildx as a 'docker builder' alias" ,
@@ -187,7 +211,13 @@ format: "default|<id>[=<socket>|<key>[,<key>]]"`)
187211 buildxBuildFlags .BoolVar (& ignoreBool , "force-rm" , false , "Always remove intermediate containers" )
188212 buildxBuildFlags .MarkHidden ("force-rm" )
189213
214+ buildxDialStdioFlags := buildxDialStdioCmd .Flags ()
215+
216+ buildxDialStdioFlags .String ("platform" , os .Getenv ("DOCKER_DEFAULT_PLATFORM" ), "Target platform: this is used for node selection" )
217+ buildxDialStdioFlags .String ("progress" , "quiet" , "Set type of progress output (auto, plain, tty)." )
218+
190219 buildxCmd .AddCommand (buildxBuildCmd )
220+ buildxCmd .AddCommand (buildxDialStdioCmd )
191221 buildxCmd .AddCommand (buildxInstallCmd )
192222 buildxCmd .AddCommand (buildxStopCmd )
193223 dockerCmd .AddCommand (buildxCmd )
@@ -205,7 +235,7 @@ func TestGenAllTree(t *testing.T) {
205235 require .NoError (t , copyFile (path .Join ("fixtures" , "buildx_stop.pre.md" ), path .Join (tmpdir , "buildx_stop.md" )))
206236
207237 c , err := New (Options {
208- Root : buildxCmd ,
238+ Root : dockerCmd ,
209239 SourceDir : tmpdir ,
210240 Plugin : true ,
211241 ManHeader : & doc.GenManHeader {
0 commit comments