@@ -67,6 +67,7 @@ type runOptions struct {
6767 noDeps bool
6868 ignoreOrphans bool
6969 removeOrphans bool
70+ quiet bool
7071 quietPull bool
7172}
7273
@@ -180,6 +181,14 @@ func runCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service) *
180181 options.noTty = !options.tty
181182 }
182183 }
184+ if options.quiet {
185+ progress.Mode = progress.ModeQuiet
186+ devnull, err := os.Open(os.DevNull)
187+ if err != nil {
188+ return err
189+ }
190+ os.Stdout = devnull
191+ }
183192 createOpts.pullChanged = cmd.Flags().Changed("pull")
184193 return nil
185194 }),
@@ -222,6 +231,8 @@ func runCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service) *
222231 flags.BoolVar(&options.useAliases, "use-aliases", false, "Use the service's network useAliases in the network(s) the container connects to")
223232 flags.BoolVarP(&options.servicePorts, "service-ports", "P", false, "Run command with all service's ports enabled and mapped to the host")
224233 flags.StringVar(&createOpts.Pull, "pull", "policy", `Pull image before running ("always"|"missing"|"never")`)
234+ flags.BoolVarP(&options.quiet, "quiet", "q", false, "Don't print anything to STDOUT")
235+ flags.BoolVar(&buildOpts.quiet, "quiet-build", false, "Suppress progress output from the build process")
225236 flags.BoolVar(&options.quietPull, "quiet-pull", false, "Pull without printing progress information")
226237 flags.BoolVar(&createOpts.Build, "build", false, "Build image before starting container")
227238 flags.BoolVar(&options.removeOrphans, "remove-orphans", false, "Remove containers for services not defined in the Compose file")
0 commit comments