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] Overlapping print rows while building #12370

Closed
MattiasOz opened this issue Dec 10, 2024 · 11 comments · Fixed by #12442
Closed

[BUG] Overlapping print rows while building #12370

MattiasOz opened this issue Dec 10, 2024 · 11 comments · Fixed by #12442
Assignees
Labels

Comments

@MattiasOz
Copy link

Description

When docker-compose is building images the printout seems to be confused about which rows to use. It prints out, e.g., both a Dockerfile instruction, like COPY, as well as the current container status on the same row. This results in a constant switching between what is written.

Steps To Reproduce

  1. Enter a directory with a docker-compose.yml file
  2. Run docker-compose build --no-cache

Compose Version

`docker compose version`:
`Docker Compose version 2.31.0`

`docker-compose version`:
`Docker Compose version 2.31.0`

Docker Environment

Client:
 Version:    27.3.1
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  2.31.0
    Path:     /usr/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 4
  Running: 3
  Paused: 0
  Stopped: 1
 Images: 978
 Server Version: 27.3.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: true
  Native Overlay Diff: false
  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 splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 207ad711eabd375a01713109a8a197d197ff6542.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.63-1-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 13.34GiB
 Name: Saturn
 ID: e1c30eb4-300f-4d4d-97d4-2cdbd78aeca8
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

I don't really know what caused it to happen. I know the steps to reproduce aren't satisfactory but I'm not sure what else to write. Any insight regarding the printout is appreciated.
Here's an image as well as a video of the building process.
Image
https://github.com/user-attachments/assets/4a0d560c-3ce1-4192-ae2d-533789d41b45
Running with --progress plain works of course but that's sidestepping the issue.
I tried reinstalling. Neither different terminals nor tty changed anything.
P.S. build specifically doesn't have to be run, anything that would cause that specific progress type to display works.

@MattiasOz MattiasOz changed the title [BUG] Overlapping rows [BUG] Overlapping print rows while building Dec 10, 2024
@MattiasOz
Copy link
Author

Update: I works fine after downgrading to earlier versions of docker-compose, for example 2.30.3.

@ndeloof
Copy link
Contributor

ndeloof commented Dec 10, 2024

I also noticed this issue. Seems we need to disable compose progress UI while buildkit is using the console to render build state

@Kunniii
Copy link

Kunniii commented Dec 16, 2024

I have the same issue when upgrading to Docker Compose version v2.31.0. The older version works fine.

@Kunniii
Copy link

Kunniii commented Dec 19, 2024

Docker compose version v2.32.1 still having this problem

@dan-cbm
Copy link

dan-cbm commented Jan 7, 2025

I made a duplicate issue by accident, here's a gif I made of the problem though for reference

Image

@thaJeztah thaJeztah marked this as a duplicate of #12435 Jan 8, 2025
@thaJeztah thaJeztah marked this as a duplicate of #12432 Jan 8, 2025
@thaJeztah thaJeztah marked this as a duplicate of moby/moby#49234 Jan 8, 2025
@thaJeztah
Copy link
Member

In case useful for those looking into this; we had some pull requests in docker/cli recently to fix a similar issue for docker stats on Windows; here's the pull requests that helped mitigate those, in case a similar patch would help for this case;

@paskozdilar
Copy link

paskozdilar commented Jan 8, 2025

The issue seems to stem for two writers writing to Stdout and Stderr at the same time.

Interestingly enough, if I run docker compose build >/dev/null I get this clean output:

[+] Building 1/1
 ✔ Service test  Built1.1s 0s 

And if I run docker compose build 2>/dev/null I get another clean output:

[+] Building 0.6s (7/7) FINISHED                                                                             docker:default
 => [test internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 115B                                                                                   0.0s
 => [test internal] load metadata for docker.io/library/ubuntu:24.04                                                   0.5s
 => [test internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 2B                                                                                        0.0s
 => [test 1/2] FROM docker.io/library/ubuntu:24.04@sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6  0.0s
 => CACHED [test 2/2] RUN apt-get -y update && apt-get -y install netcat-openbsd                                       0.0s
 => [test] exporting to image                                                                                          0.0s
 => => exporting layers                                                                                                0.0s
 => => writing image sha256:8c2534414ce76df77505dc59da6e4939ff89e24321da5912ede591194781bbc7                           0.0s
 => => naming to docker.io/library/example-test                                                                        0.0s
 => [test] resolving provenance for metadata file                                                                      0.0s

So the issue seems to be the mixing of two outputs.
Since the second output is more than enough, disabling the Stderr output could be a workaround.

OR

We could just decide to use either Stdout or Stderr for both buildkit and compose output, and not both.
After testing, I can say that work. We would get the same jitters, only a little cleaner.

Perhaps buildkit output needs to always be two lines above the compose output - that way both would get their own scratch space and not trample each other.

@swisslala
Copy link

Downgraded to 4.36 and problem still persists. Builds are super slow and unstable.

Disabling buildkit fixes the flicker at the cost of time but something is def off. Builds that took a min now go into 5+ minutes.

@dylan1951
Copy link

Yeah something is cooked. Ever since it started flickering the builds take much longer.

@jove4015
Copy link

Just checking - I see this issue is closed but I'm still having this issue on a brand new install. When is the fix for this going to be released?

@stephaneredpill
Copy link

Just received an email recommending upgrading to Docker Desktop 4.37.2 (179585) with Compose: v2.31.0-desktop.2 and the flickering issue is still happening.

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

Successfully merging a pull request may close this issue.

10 participants