From d10a179f3e451f8b03fd99271f011c34bc31bedb Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:52:06 +0100 Subject: [PATCH] add support of QuietOption to create command Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- cmd/compose/create.go | 3 ++- docs/reference/compose_create.md | 1 + docs/reference/docker_compose_create.yaml | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/compose/create.go b/cmd/compose/create.go index fbbeed700..bf21ee7af 100644 --- a/cmd/compose/create.go +++ b/cmd/compose/create.go @@ -75,6 +75,7 @@ func createCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service flags.BoolVar(&opts.Build, "build", false, "Build images before starting containers") flags.BoolVar(&opts.noBuild, "no-build", false, "Don't build an image, even if it's policy") flags.StringVar(&opts.Pull, "pull", "policy", `Pull image before running ("always"|"missing"|"never"|"build")`) + flags.BoolVar(&opts.quietPull, "quiet-pull", false, "Pull without printing progress information") flags.BoolVar(&opts.forceRecreate, "force-recreate", false, "Recreate containers even if their configuration and image haven't changed") flags.BoolVar(&opts.noRecreate, "no-recreate", false, "If containers already exist, don't recreate them. Incompatible with --force-recreate.") flags.BoolVar(&opts.removeOrphans, "remove-orphans", false, "Remove containers for services not defined in the Compose file") @@ -105,7 +106,7 @@ func runCreate(ctx context.Context, _ command.Cli, backend api.Service, createOp RecreateDependencies: createOpts.dependenciesRecreateStrategy(), Inherit: !createOpts.noInherit, Timeout: createOpts.GetTimeout(), - QuietPull: false, + QuietPull: createOpts.quietPull, }) } diff --git a/docs/reference/compose_create.md b/docs/reference/compose_create.md index 386d6359a..06293625a 100644 --- a/docs/reference/compose_create.md +++ b/docs/reference/compose_create.md @@ -13,6 +13,7 @@ Creates containers for a service | `--no-build` | | | Don't build an image, even if it's policy | | `--no-recreate` | | | If containers already exist, don't recreate them. Incompatible with --force-recreate. | | `--pull` | `string` | `policy` | Pull image before running ("always"\|"missing"\|"never"\|"build") | +| `--quiet-pull` | | | Pull without printing progress information | | `--remove-orphans` | | | Remove containers for services not defined in the Compose file | | `--scale` | `stringArray` | | Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present. | diff --git a/docs/reference/docker_compose_create.yaml b/docs/reference/docker_compose_create.yaml index 34425aebb..a07e1c88c 100644 --- a/docs/reference/docker_compose_create.yaml +++ b/docs/reference/docker_compose_create.yaml @@ -57,6 +57,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: quiet-pull + value_type: bool + default_value: "false" + description: Pull without printing progress information + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: remove-orphans value_type: bool default_value: "false"