Skip to content

[BUG] Every line in the output gets duplicated #13101

@chocolateimage

Description

@chocolateimage

Description

When using docker compose up, every line in the output gets duplicated:

$ docker compose up        
Attaching to app-1
app-1  | Hello
app-1  | Hello
app-1  | Again another line
app-1  | Again another line
app-1 exited with code 0

This does not happen with running Docker directly with docker run

Steps To Reproduce

  1. Create these files:

compose.yaml

services:
  app:
    build: .

Dockerfile

FROM alpine:latest

WORKDIR /app

COPY script.sh .

ENTRYPOINT ["sh", "script.sh"]

script.sh

echo "Hello"
sleep 1
echo "Again another line"
  1. Run docker compose up --build
  2. See duplicated lines in output

Compose Version

Docker Compose version 2.39.1

Docker Environment

Client:
 Version:    28.3.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.26.1
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.39.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 25
  Running: 0
  Paused: 0
  Stopped: 25
 Images: 363
 Server Version: 28.3.2
 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
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: c787fb98911740dd3ff2d0e45ce88cdf01410486.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.12.40-1-lts
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 32
 Total Memory: 30.98GiB
 Name: bright-sparkle
 ID: 86dad810-1c61-48e7-adc0-29a3bb8fc3ef
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions