@@ -27,10 +27,11 @@ import (
2727)
2828
2929var (
30- dockerCmd * cobra.Command
31- buildxCmd * cobra.Command
32- buildxBuildCmd * cobra.Command
33- buildxStopCmd * cobra.Command
30+ dockerCmd * cobra.Command
31+ buildxCmd * cobra.Command
32+ buildxBuildCmd * cobra.Command
33+ buildxInstallCmd * cobra.Command
34+ buildxStopCmd * cobra.Command
3435)
3536
3637//nolint:errcheck
@@ -62,6 +63,13 @@ func init() {
6263 "aliases" : "docker image build, docker buildx build, docker buildx b, docker build" ,
6364 },
6465 }
66+ buildxInstallCmd = & cobra.Command {
67+ Use : "install" ,
68+ Short : "Install buildx as a 'docker builder' alias" ,
69+ Args : cobra .ExactArgs (0 ),
70+ Run : func (cmd * cobra.Command , args []string ) {},
71+ Hidden : true ,
72+ }
6573 buildxStopCmd = & cobra.Command {
6674 Use : "stop [NAME]" ,
6775 Short : "Stop builder instance" ,
@@ -173,6 +181,7 @@ format: "default|<id>[=<socket>|<key>[,<key>]]"`)
173181 buildxBuildFlags .MarkHidden ("force-rm" )
174182
175183 buildxCmd .AddCommand (buildxBuildCmd )
184+ buildxCmd .AddCommand (buildxInstallCmd )
176185 buildxCmd .AddCommand (buildxStopCmd )
177186 dockerCmd .AddCommand (buildxCmd )
178187}
@@ -192,7 +201,7 @@ func TestGenAllTree(t *testing.T) {
192201 require .NoError (t , err )
193202 require .NoError (t , c .GenAllTree ())
194203
195- for _ , tt := range []string {"buildx.md" , "buildx_build.md" , "buildx_stop.md" , "docker_buildx.yaml" , "docker_buildx_build.yaml" , "docker_buildx_stop.yaml" } {
204+ for _ , tt := range []string {"buildx.md" , "buildx_build.md" , "buildx_stop.md" , "docker_buildx.yaml" , "docker_buildx_build.yaml" , "docker_buildx_install.yaml" , " docker_buildx_stop.yaml" } {
196205 tt := tt
197206 t .Run (tt , func (t * testing.T ) {
198207 bres , err := os .ReadFile (filepath .Join (tmpdir , tt ))
0 commit comments