@@ -45,24 +45,25 @@ type buildOptions struct {
4545func Cmd (dockerCli command.Cli ) * cobra.Command {
4646 var opts buildOptions
4747 cmd := & cobra.Command {
48- Use : "build [OPTIONS] [CONTEXT_PATH]" ,
49- Short : "Build service images for the application" ,
50- Example : `$ docker app build --tag my/app:1.0.0 .` ,
51- Args : cli .ExactArgs (1 ),
48+ Use : "build [OPTIONS] [BUILD_PATH]" ,
49+ Short : "Build an App image from an App definition (.dockerapp)" ,
50+ Example : `$ docker app build .
51+ $ docker app build . -f myapp.dockerapp -t myrepo/myapp:1.0.0` ,
52+ Args : cli .ExactArgs (1 ),
5253 RunE : func (cmd * cobra.Command , args []string ) error {
5354 return runBuild (dockerCli , args [0 ], opts )
5455 },
5556 }
5657
5758 flags := cmd .Flags ()
58- flags .BoolVar (& opts .noCache , "no-cache" , false , "Do not use cache when building the image" )
59+ flags .BoolVar (& opts .noCache , "no-cache" , false , "Do not use cache when building the App image" )
5960 flags .StringVar (& opts .progress , "progress" , "auto" , "Set type of progress output (auto, plain, tty). Use plain to show container output" )
60- flags .StringVarP (& opts .tag , "tag" , "t" , "" , "Application image and optionally a tag in the 'image :tag' format" )
61- flags .StringVarP (& opts .folder , "folder" , "f" , "" , "Docker app folder containing application definition " )
62- flags .BoolVar (& opts .pull , "pull" , false , "Always attempt to pull a newer version of the image" )
61+ flags .StringVarP (& opts .tag , "tag" , "t" , "" , "App image tag, optionally in the 'repo :tag' format" )
62+ flags .StringVarP (& opts .folder , "folder" , "f" , "" , "App definition as a .dockerapp directory " )
63+ flags .BoolVar (& opts .pull , "pull" , false , "Always attempt to pull a newer version of the App image" )
6364 flags .StringArrayVar (& opts .args , "build-arg" , []string {}, "Set build-time variables" )
64- flags .BoolVarP (& opts .quiet , "quiet" , "q" , false , "Suppress the build output and print app image ID on success" )
65- flags .StringVar (& opts .imageIDFile , "iidfile" , "" , "Write the app image ID to the file" )
65+ flags .BoolVarP (& opts .quiet , "quiet" , "q" , false , "Suppress the build output and print App image ID on success" )
66+ flags .StringVar (& opts .imageIDFile , "iidfile" , "" , "Write the App image ID to the file" )
6667
6768 return cmd
6869}
@@ -190,7 +191,7 @@ func getAppFolder(opt buildOptions, contextPath string) (string, error) {
190191 for _ , f := range files {
191192 if strings .HasSuffix (f .Name (), ".dockerapp" ) {
192193 if application != "" {
193- return "" , fmt .Errorf ("%s contains multiple * .dockerapp folders , use -f option to select the one to build" , contextPath )
194+ return "" , fmt .Errorf ("%s contains multiple .dockerapp directories , use -f option to select the one to build" , contextPath )
194195 }
195196 application = filepath .Join (contextPath , f .Name ())
196197 if ! f .IsDir () {
0 commit comments