Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] docker compose run --quiet-pull doesn't work #10714

Closed
chris-dekker opened this issue Jun 15, 2023 · 16 comments
Closed

[BUG] docker compose run --quiet-pull doesn't work #10714

chris-dekker opened this issue Jun 15, 2023 · 16 comments
Assignees
Labels

Comments

@chris-dekker
Copy link

Description

Running docker compose run --quiet-pull .. should avoid printing the container pulling information, but this simply doesn't work. It still prints the following

[+] Running 2/0
 ⠿ Container my-container-1       Running                                                                                                                                                                  0.0s
 ⠿ Container my-container-2  Created

Before printing the actual container's run command output.

This messes with scripts that use the run command's output which is now mixed with container pull information.

Was already reported and re-reported here, but that issue was closed without resolution.

Steps To Reproduce

docker compose run --quiet-pull wdio npm run wdio

Compose Version

Docker Compose version v2.15.1

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  compose: Docker Compose (Docker Inc., v2.15.1)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 12
  Running: 2
  Paused: 0
  Stopped: 10
 Images: 79
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 0197261a30bf81f1ee8e6a4dd2dea0ef95d67ccb
 runc version: v1.1.3-0-g6724737
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.19.0-43-generic
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 31.1GiB
 Name: dekker-Precision-5550
 ID: K4C2:DLWX:7ZTL:COE7:5UYL:KUVF:4TTB:5VXC:OHHQ:PXNY:3QBZ:FK2J
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: chrisdekker
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 10.0.0.0/16, Size: 24

Anything else?

No response

@glours
Copy link
Contributor

glours commented Jun 15, 2023

Hello @chris-dekker
Those logs aren't link to pull, they are regular Compose logs about services states.
Here an example with pull output logs, which means in your case --quiet-pull works as expected as you didn't see those type of logs

docker compose run mongo
[+] Building 0.0s (0/0)
[+] Creating 1/0
 ✔ Network nginx-flask-mongo_default  Created                                                                                                                                                                                            0.0s
[+] Running 13/13
 ✔ mongo 12 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                                                10.4s
   ✔ b3761fda5176 Download complete                                                                                                                                                                                                      0.3s
   ✔ d9ee96a095b0 Download complete                                                                                                                                                                                                      0.2s
   ✔ 376ea24ce0f0 Download complete                                                                                                                                                                                                      0.2s
   ✔ 49809477b7bb Download complete                                                                                                                                                                                                      0.4s
   ✔ 9a26b2cb251f Download complete                                                                                                                                                                                                      0.2s
   ✔ 8c113973dff3 Download complete                                                                                                                                                                                                      0.4s
   ✔ 7733cfe8e25e Download complete                                                                                                                                                                                                      0.3s
   ✔ d09a4405ccbc Download complete                                                                                                                                                                                                      0.3s
   ✔ ca2f6dd7bfa2 Download complete                                                                                                                                                                                                      5.7s
   ✔ 95542cdd3e5b Download complete                                                                                                                                                                                                      0.3s
   ✔ 6c7698a779f6 Download complete                                                                                                                                                                                                      3.5s
   ✔ 0bf03b60a39a Download complete                                                                                                                                                                                                      0.3s
[+] Building 0.0s (0/0)

@glours glours self-assigned this Jun 15, 2023
@chris-dekker
Copy link
Author

Thanks for the reply @glours ! so what is the way to avoid those service state logs altogether to only print the run command's output?

@glours
Copy link
Contributor

glours commented Jun 15, 2023

This is the default output of the run command:

  • pull & build logs
  • followed by the containers lifecycle logs (creating, starting, healthy...)
  • and then logs produces by your containers when running

@chris-dekker
Copy link
Author

How do I get just the latter?

@glours
Copy link
Contributor

glours commented Jun 15, 2023

Did you try to do a docker compose run -d my-service and then use docker logs my-service-container-name (you can't use docker compose logs as the run will start orphan containers and not services)

@hiroshi
Copy link

hiroshi commented Jun 16, 2023

@leberknecht
Copy link

While the OP seems to actually have a different problem, I do get the pull logs on gitlab even with --quite-pull =>

$ docker-compose -f docker-compose.test.yml -f docker-compose.yml run --quiet-pull php-test # collapsed multi-line command
 db Pulling 
 df20fa9351a1 Pulling fs layer 
 600cd4e17445 Pulling fs layer 
 04c8eedc9a76 Pulling fs layer 
 2704c561b4e3 Pulling fs layer 
 db082802a6cb Pulling fs layer 
 4d2a93e8110b Pulling fs layer 
 ae8ba07f5a37 Pulling fs layer 
 3cfbb9fe5e84 Pulling fs layer 
 005b6bf61c53 Pulling fs layer 
 4d2a93e8110b Waiting 
 ae8ba07f5a37 Waiting 
 3cfbb9fe5e84 Waiting 
 005b6bf61c53 Waiting 
 2704c561b4e3 Waiting 
 db082802a6cb Waiting 
 04c8eedc9a76 Downloading [==================================================>]     115B/115B
 04c8eedc9a76 Download complete 
 600cd4e17445 Downloading [==============================>                    ]     758B/1.248kB
 600cd4e17445 Downloading [==================================================>]  1.248kB/1.248kB
 600cd4e17445 Verifying Checksum 
 600cd4e17445 Download complete 
 df20fa9351a1 Downloading [>                                                  ]  28.75kB/2.798MB
 df20fa9351a1 Verifying Checksum 
 df20fa9351a1 Download complete 
 df20fa9351a1 Extracting [>                                                  ]  32.77kB/2.798MB
 df20fa9351a1 Extracting [=================================>                 ]  1.901MB/2.798MB
 df20fa9351a1 Extracting [==================================================>]  2.798MB/2.798MB
 df20fa9351a1 Pull complete 
 600cd4e17445 Extracting [==================================================>]  1.248kB/1.248kB
 600cd4e17445 Extracting [==================================================>]  1.248kB/1.248kB
 600cd4e17445 Pull complete 
 04c8eedc9a76 Extracting [==================================================>]     115B/115B
 04c8eedc9a76 Extracting [==================================================>]     115B/115B
 db082802a6cb Downloading [=====>                                             ]     758B/7.573kB
 db082802a6cb Downloading [==================================================>]  7.573kB/7.573kB
 db082802a6cb Download complete 
 2704c561b4e3 Downloading [>                                                  ]    539kB/57.58MB
 4d2a93e8110b Downloading [==================================================>]     128B/128B
 4d2a93e8110b Verifying Checksum 
 4d2a93e8110b Download complete 
 04c8eedc9a76 Pull complete 
 2704c561b4e3 Downloading [==========>                                        ]  11.84MB/57.58MB
 2704c561b4e3 Downloading [===================>                               ]  22.59MB/57.58MB
 ae8ba07f5a37 Downloading [==================================================>]     164B/164B
 ae8ba07f5a37 Verifying Checksum 
 ae8ba07f5a37 Download complete 
 2704c561b4e3 Downloading [============================>                      ]  33.28MB/57.58MB
 3cfbb9fe5e84 Downloading [========>                                          ]     759B/4.262kB
 3cfbb9fe5e84 Downloading [==================================================>]  4.262kB/4.262kB
 3cfbb9fe5e84 Verifying Checksum 
 3cfbb9fe5e84 Download complete 
 2704c561b4e3 Downloading [======================================>            ]  44.03MB/57.58MB
 2704c561b4e3 Downloading [===============================================>   ]  55.25MB/57.58MB
 2704c561b4e3 Verifying Checksum 
 2704c561b4e3 Download complete 
 2704c561b4e3 Extracting [>                                                  ]  557.1kB/57.58MB
 005b6bf61c53 Downloading [==================================================>]     121B/121B
 005b6bf61c53 Verifying Checksum 
 005b6bf61c53 Download complete 
 2704c561b4e3 Extracting [==>                                                ]  2.785MB/57.58MB
 2704c561b4e3 Extracting [======>                                            ]  7.242MB/57.58MB
 2704c561b4e3 Extracting [==========>                                        ]  12.26MB/57.58MB
 2704c561b4e3 Extracting [==============>                                    ]  16.15MB/57.58MB
 2704c561b4e3 Extracting [================>                                  ]  18.94MB/57.58MB
 2704c561b4e3 Extracting [==================>                                ]  21.73MB/57.58MB
 2704c561b4e3 Extracting [=====================>                             ]  25.07MB/57.58MB
 2704c561b4e3 Extracting [========================>                          ]  27.85MB/57.58MB
 2704c561b4e3 Extracting [===========================>                       ]   31.2MB/57.58MB
 2704c561b4e3 Extracting [=============================>                     ]  34.54MB/57.58MB
 2704c561b4e3 Extracting [================================>                  ]  37.88MB/57.58MB
 2704c561b4e3 Extracting [====================================>              ]  42.34MB/57.58MB
 2704c561b4e3 Extracting [=====================================>             ]  43.45MB/57.58MB
 2704c561b4e3 Extracting [========================================>          ]  46.24MB/57.58MB
 2704c561b4e3 Extracting [==========================================>        ]  49.02MB/57.58MB
 2704c561b4e3 Extracting [============================================>      ]  51.81MB/57.58MB
 2704c561b4e3 Extracting [================================================>  ]  55.71MB/57.58MB
 2704c561b4e3 Extracting [==================================================>]  57.58MB/57.58MB
 2704c561b4e3 Pull complete 
 db082802a6cb Extracting [==================================================>]  7.573kB/7.573kB
 db082802a6cb Extracting [==================================================>]  7.573kB/7.573kB
 db082802a6cb Pull complete 
 4d2a93e8110b Extracting [==================================================>]     128B/128B
 4d2a93e8110b Extracting [==================================================>]     128B/128B
 4d2a93e8110b Pull complete 
 ae8ba07f5a37 Extracting [==================================================>]     164B/164B
 ae8ba07f5a37 Extracting [==================================================>]     164B/164B
 ae8ba07f5a37 Pull complete 
 3cfbb9fe5e84 Extracting [==================================================>]  4.262kB/4.262kB
 3cfbb9fe5e84 Extracting [==================================================>]  4.262kB/4.262kB
 3cfbb9fe5e84 Pull complete 
 005b6bf61c53 Extracting [==================================================>]     121B/121B
 005b6bf61c53 Extracting [==================================================>]     121B/121B
 005b6bf61c53 Pull complete 

compose version:

$ docker-compose version
Docker Compose version v2.18.1

docker:

$ docker version
Client:
 Version:           24.0.2
 API version:       1.41 (downgraded from 1.43)
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:50:49 2023
 OS/Arch:           linux/amd64
 Context:           default
Server: Docker Engine - Community
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.10
  Git commit:       f756502
  Built:            Thu May 12 09:19:16 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.6.4
  GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc:
  Version:          1.1.1
  GitCommit:        v1.1.1-0-g52de29d7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Im a missing something?

@uuf6429
Copy link

uuf6429 commented Aug 18, 2023

I see the same thing as @leberknecht.

The situation is a quite frustrating because in CI, while I can hide/ignore the pull step verbose output, because of this bug, I'm forced to have a run step containing the pull progress and the run output that I'm interested in.

Or in other words, it seems way more valuable to have --quiet-pull implemented on run rather than pull.

(docker compose run -d ... && docker compose logs is not a good alternative since it doesn't "proxy" service failures)

@jholm117
Copy link

jholm117 commented Nov 7, 2023

Hello! I am seeing the same as @leberknecht. Is there any update on this issue? Thanks!

@glours
Copy link
Contributor

glours commented Nov 21, 2023

@uuf6429 --quite-pull is available with run command since Compose v2.2.0
@leberknecht @jholm117 can you confirm you still have the issue with recent version of Compose?
Can you try to reproduce with this simple sample?

services:
  mongo:
    image: mongo

As you can see everything is displayed as expected on my side with Compose v2.23.1

> bat compose.yaml
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: compose.yaml
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ services:
   2   │   mongo:
   3   │     image: mongo
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> docker compose run -d --quiet-pull mongo
[+] Creating 1/0
 ✔ Network issue-1074_default  Created                                                                                                                                                                                              0.1s
[+] Running 1/1
 ✔ mongo Pulled                                                                                                                                                                                                                     9.9s
36ea203fb8aedf4dabb59cd10adea785601f20f6d126cc01642bb6e90523c523
> docker compose down --rmi all --remove-orphans
[+] Running 3/3
 ✔ Container issue-1074-mongo-run-d1b508d1ab11  Removed                                                                                                                                                                             0.2s
 ✔ Image mongo:latest                           Removed                                                                                                                                                                             0.4s
 ✔ Network issue-1074_default                   Removed                                                                                                                                                                             0.1s
> docker compose run -d mongo
[+] Creating 1/0
 ✔ Network issue-1074_default  Created                                                                                                                                                                                              0.1s
[+] Running 5/5
 ✔ mongo 4 layers [⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                                                     9.6s
   ✔ c39807cb848f Download complete                                                                                                                                                                                                 0.3s
   ✔ 0beb4a4f2118 Download complete                                                                                                                                                                                                 0.4s
   ✔ b8d8399c849e Download complete                                                                                                                                                                                                 5.2s
   ✔ 208482253dd3 Download complete                                                                                                                                                                                                 0.4s
2d94a6a8a0a0e56f6e5a05e620e911ec9517d1ef6333318a3c340f0a41db7994

@glours
Copy link
Contributor

glours commented Jan 8, 2024

As mentioned in the contributing guide, without any feedback to our last comment for a while I'm closing the issue

@glours glours closed this as completed Jan 8, 2024
@erickguan
Copy link

erickguan commented Feb 16, 2024

@glours I can replicate the issue with docker compose v2.23.3 with GitHub Action runner (hosted by GitHub). Hopefully it's enough to reopen the issue.

version: '3.8'

services:
  mongo:
    image: mongo:4.4.28@sha256:17330999a8d1e2f8d1805596c48a7dab5265d8da36ac4de20a5c35c32ea2d6b8
    tmpfs: /data/db
    command: --bind_ip localhost,mongo

  my-container:
    # omit

The command is:

  docker compose \
    --file compose.test.yml \
    run \
      --rm \
      --quiet-pull \
      nexus

Here is the output:

2024-02-16T09:05:25.2213690Z  mongo Pulling 
2024-02-16T09:05:25.5060816Z  8ee087424735 Already exists 
2024-02-16T09:05:25.5077251Z  c87203314cdf Pulling fs layer 
2024-02-16T09:05:25.5078360Z  b9fd0cd199ec Pulling fs layer 
2024-02-16T09:05:25.5078890Z  f8d94a571dac Pulling fs layer 
2024-02-16T09:05:25.5079636Z  0a5bacd0f714 Pulling fs layer 
2024-02-16T09:05:25.5080235Z  38c90867523a Pulling fs layer 
2024-02-16T09:05:25.5080691Z  72ef68f8c101 Pulling fs layer 
2024-02-16T09:05:25.5081252Z  e23cdbba0406 Pulling fs layer 
2024-02-16T09:05:25.5081728Z  ac227d2d3299 Pulling fs layer 
2024-02-16T09:05:25.5082269Z  0a5bacd0f714 Waiting 
2024-02-16T09:05:25.5082750Z  38c90867523a Waiting 
2024-02-16T09:05:25.5083173Z  72ef68f8c101 Waiting 
2024-02-16T09:05:25.5083650Z  e23cdbba0406 Waiting 
2024-02-16T09:05:25.5084100Z  ac227d2d3299 Waiting 
2024-02-16T09:05:25.5792313Z  f8d94a571dac Downloading [>                                                  ]  11.54kB/1.1MB
2024-02-16T09:05:25.5851499Z  b9fd0cd199ec Downloading [>                                                  ]  86.68kB/8.373MB
2024-02-16T09:05:25.6011011Z  f8d94a571dac Verifying Checksum 
2024-02-16T09:05:25.6011515Z  f8d94a571dac Download complete 
2024-02-16T09:05:25.6384081Z  b9fd0cd199ec Verifying Checksum 
2024-02-16T09:05:25.6384831Z  b9fd0cd199ec Download complete 
2024-02-16T09:05:25.6774006Z  0a5bacd0f714 Downloading [==================================================>]     116B/116B
2024-02-16T09:05:25.6774752Z  0a5bacd0f714 Verifying Checksum 
2024-02-16T09:05:25.6775237Z  0a5bacd0f714 Download complete 
2024-02-16T09:05:25.7243252Z  38c90867523a Downloading [==========================>                        ]     733B/1.394kB
2024-02-16T09:05:25.7244299Z  38c90867523a Downloading [==================================================>]  1.394kB/1.394kB
2024-02-16T09:05:25.7245115Z  38c90867523a Verifying Checksum 
2024-02-16T09:05:25.7245607Z  38c90867523a Download complete 
2024-02-16T09:05:25.7474366Z  72ef68f8c101 Downloading [==================================================>]     258B/258B
2024-02-16T09:05:25.7475318Z  72ef68f8c101 Verifying Checksum 
2024-02-16T09:05:25.7475811Z  72ef68f8c101 Download complete 
2024-02-16T09:05:25.8269322Z  ac227d2d3299 Downloading [=======>                                           ]     721B/4.993kB
2024-02-16T09:05:25.8270740Z  ac227d2d3299 Downloading [==================================================>]  4.993kB/4.993kB
2024-02-16T09:05:25.8271593Z  ac227d2d3299 Download complete 
2024-02-16T09:05:25.8296495Z  e23cdbba0406 Downloading [>                                                  ]  534.8kB/139.3MB
2024-02-16T09:05:25.8499856Z  c87203314cdf Downloading [====================>                              ]     733B/1.783kB
2024-02-16T09:05:25.8500775Z  c87203314cdf Downloading [==================================================>]  1.783kB/1.783kB
2024-02-16T09:05:25.8501566Z  c87203314cdf Download complete 
2024-02-16T09:05:25.8502252Z  c87203314cdf Extracting [==================================================>]  1.783kB/1.783kB
2024-02-16T09:05:25.8503161Z  c87203314cdf Extracting [==================================================>]  1.783kB/1.783kB
2024-02-16T09:05:25.8681321Z  c87203314cdf Pull complete 
2024-02-16T09:05:25.8742181Z  b9fd0cd199ec Extracting [>                                                  ]   98.3kB/8.373MB
2024-02-16T09:05:25.9314637Z  e23cdbba0406 Downloading [======>                                            ]  19.38MB/139.3MB
2024-02-16T09:05:25.9750814Z  b9fd0cd199ec Extracting [================================>                  ]  5.407MB/8.373MB
2024-02-16T09:05:26.0326587Z  e23cdbba0406 Downloading [==============>                                    ]  41.45MB/139.3MB
2024-02-16T09:05:26.1011768Z  b9fd0cd199ec Extracting [==================================================>]  8.373MB/8.373MB
2024-02-16T09:05:26.1349127Z  e23cdbba0406 Downloading [==================>                                ]  51.67MB/139.3MB
2024-02-16T09:05:26.1417936Z  b9fd0cd199ec Pull complete 
2024-02-16T09:05:26.1427482Z  f8d94a571dac Extracting [=>                                                 ]  32.77kB/1.1MB
2024-02-16T09:05:26.1575333Z  f8d94a571dac Extracting [==================================================>]    1.1MB/1.1MB
2024-02-16T09:05:26.1578781Z  f8d94a571dac Extracting [==================================================>]    1.1MB/1.1MB
2024-02-16T09:05:26.1701901Z  f8d94a571dac Pull complete 
2024-02-16T09:05:26.1712526Z  0a5bacd0f714 Extracting [==================================================>]     116B/116B
2024-02-16T09:05:26.1713987Z  0a5bacd0f714 Extracting [==================================================>]     116B/116B
2024-02-16T09:05:26.1764534Z  0a5bacd0f714 Pull complete 
2024-02-16T09:05:26.1775341Z  38c90867523a Extracting [==================================================>]  1.394kB/1.394kB
2024-02-16T09:05:26.1776338Z  38c90867523a Extracting [==================================================>]  1.394kB/1.394kB
2024-02-16T09:05:26.1845593Z  38c90867523a Pull complete 
2024-02-16T09:05:26.1855246Z  72ef68f8c101 Extracting [==================================================>]     258B/258B
2024-02-16T09:05:26.1856938Z  72ef68f8c101 Extracting [==================================================>]     258B/258B
2024-02-16T09:05:26.1941381Z  72ef68f8c101 Pull complete 
2024-02-16T09:05:26.2368437Z  e23cdbba0406 Downloading [=======================>                           ]  66.68MB/139.3MB
2024-02-16T09:05:26.3369164Z  e23cdbba0406 Downloading [===============================>                   ]  88.71MB/139.3MB
2024-02-16T09:05:26.4370697Z  e23cdbba0406 Downloading [=======================================>           ]  109.1MB/139.3MB
2024-02-16T09:05:26.5380473Z  e23cdbba0406 Downloading [=============================================>     ]  127.3MB/139.3MB
2024-02-16T09:05:26.6006113Z  e23cdbba0406 Verifying Checksum 
2024-02-16T09:05:26.6006684Z  e23cdbba0406 Download complete 
2024-02-16T09:05:26.6117488Z  e23cdbba0406 Extracting [>                                                  ]  557.1kB/139.3MB
2024-02-16T09:05:26.7166308Z  e23cdbba0406 Extracting [===>                                               ]  10.03MB/139.3MB
2024-02-16T09:05:26.8195392Z  e23cdbba0406 Extracting [=======>                                           ]  20.05MB/139.3MB
2024-02-16T09:05:26.9359787Z  e23cdbba0406 Extracting [==========>                                        ]  28.41MB/139.3MB
2024-02-16T09:05:27.0399886Z  e23cdbba0406 Extracting [=============>                                     ]  38.44MB/139.3MB
2024-02-16T09:05:27.1432724Z  e23cdbba0406 Extracting [=================>                                 ]  48.46MB/139.3MB
2024-02-16T09:05:27.2466036Z  e23cdbba0406 Extracting [====================>                              ]  56.82MB/139.3MB
2024-02-16T09:05:27.3520109Z  e23cdbba0406 Extracting [=======================>                           ]  66.29MB/139.3MB
2024-02-16T09:05:27.4549049Z  e23cdbba0406 Extracting [===========================>                       ]  76.32MB/139.3MB
2024-02-16T09:05:27.5571711Z  e23cdbba0406 Extracting [===============================>                   ]  88.01MB/139.3MB
2024-02-16T09:05:27.6727416Z  e23cdbba0406 Extracting [===================================>               ]   98.6MB/139.3MB
2024-02-16T09:05:27.7786445Z  e23cdbba0406 Extracting [======================================>            ]  108.6MB/139.3MB
2024-02-16T09:05:27.8841513Z  e23cdbba0406 Extracting [==========================================>        ]  119.8MB/139.3MB
2024-02-16T09:05:27.9854237Z  e23cdbba0406 Extracting [=============================================>     ]  126.5MB/139.3MB
2024-02-16T09:05:28.0961538Z  e23cdbba0406 Extracting [=================================================> ]  138.1MB/139.3MB
2024-02-16T09:05:28.3899013Z  e23cdbba0406 Extracting [=================================================> ]  138.7MB/139.3MB
2024-02-16T09:05:28.4202664Z  e23cdbba0406 Extracting [==================================================>]  139.3MB/139.3MB
2024-02-16T09:05:28.5189050Z  e23cdbba0406 Pull complete 
2024-02-16T09:05:28.5196744Z  ac227d2d3299 Extracting [==================================================>]  4.993kB/4.993kB
2024-02-16T09:05:28.5199454Z  ac227d2d3299 Extracting [==================================================>]  4.993kB/4.993kB
2024-02-16T09:05:28.5263562Z  ac227d2d3299 Pull complete 
2024-02-16T09:05:28.5309128Z  mongo Pulled 
2024-02-16T09:05:28.5336616Z  Network application_default  Creating
2024-02-16T09:05:28.6383617Z  Network application_default  Created
2024-02-16T09:05:28.6384916Z  Container application-mongo-1  Creating
2024-02-16T09:05:28.6519533Z  Container application-mongo-1  Created
2024-02-16T09:05:28.6571816Z  Container application-mongo-1  Starting
2024-02-16T09:05:28.8529077Z  Container application-mongo-1  Started
container output start...

The difference in running the command is the daemon.

@leberknecht
Copy link

the --quiet flag seems to work for me on pull but --quiet-pull still not working as expected on run. So as a workaround i can explicitly fire a docker-compose pull --quiet service1 service2.. before the run.
Tested with v2.24.5.

@glours
Copy link
Contributor

glours commented Feb 16, 2024

@erickguan @leberknecht
Sorry I'm still not able to reproduce, I'm using the v2.24.5 shipped with Docker Desktop in this example
@erickguan I used your sample
Screenshot 2024-02-16 at 11 07 15

@leberknecht
Copy link

Hm, i checked again, i can confirm that --quiet-pull works like expected now on my local...just not on gitlab oO
Which seems very strange, most likely something buggy on my pipeline. Not sure, have double checked that the 2.24.5 is used. I will experiment a bit to find out if maybe some env-parameter has a side-effect.

@erickguan
Copy link

erickguan commented Feb 16, 2024

@glours Thanks for checking! I can replicate the same in my terminal on a Macbook Pro. The log I posted comes from Github Actions. I would like the --quiet-pull suppresses pulling logs in non-tty devices too. So on the GitHub runner terminal, there is no cursor, no job control, etc.

I am puzzled. The only difference was tty between GitHub Actions runner and my terminal.
This is a github runner log. https://github.com/erickguan/debug-docker-compose-quiet-pull/actions/runs/7938042931/job/21676297535
Another one with --progress=plain https://github.com/erickguan/debug-docker-compose-quiet-pull/actions/runs/7938114667/job/21676476372
Another one with --progress=silent https://github.com/erickguan/debug-docker-compose-quiet-pull/actions/runs/7938109063/job/21676462590

So progress is the core writer to the log. Then I did some digging in the code.
I can see pull respects quietPull.
https://github.com/docker/compose/blob/main/pkg/compose/pull.go#L228-L230
This is correct from build -> pull.

But did run get the right flags?
https://github.com/docker/compose/blob/main/cmd/compose/run.go#L158-L190
options.quietPull is the flag.

When starting dependencies, it seems this flag is not passing to startDependencies. https://github.com/docker/compose/blob/main/cmd/compose/run.go#L213-L235
Can it cause the writer to create pull log because of it in GitHub Action?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants