Skip to content

[BUG] compose run display [+] Building X.Ys (n/m)on stdout even if there is nothing to build #10619

@mageekguy

Description

@mageekguy

Description

docker compose run write informations related to building on stdout instead of stderr.
Moreover, these informations are useless because there is nothing to build in my context.

Steps To Reproduce

I'm using Fedora 38 with the following docker-compose.yml:

471|1358> cat docker-compose.yml 
version: '2.4'

services:
   php:
      image: php:8.2.6-cli
      volumes:
         - .:/src
      working_dir: /src

When I do /usr/bin/docker compose run --rm php php --version 2>/dev/null, I obtain the following output:

473|1360> /usr/bin/docker compose run --rm php php --version 2>/dev/null
[+] Building 0.0s (0/0)                                                                                                                                                                                                                                        
[+] Building 0.0s (0/0)                                                                                                                                                                                                                                        
PHP 8.2.6 (cli) (built: May 23 2023 04:11:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.6, Copyright (c) Zend Technologies

The problem is the two lines [+] Building 0.0s (0/0), because from my point of view, these lines are useless in this context, and even if it is not the case, they should be sent to stderr instead of stdout.

Compose Version

Docker Compose version v2.18.1

docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.11.3
OpenSSL version: OpenSSL 3.0.8 7 Feb 2023

Docker Environment

Client: Docker Engine - Community
 Version:    24.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.18.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 34
 Server Version: 24.0.1
 Storage Driver: btrfs
  Btrfs: 
 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 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.2.15-200.fc37.aarch64
 Operating System: Fedora Linux 37 (Workstation Edition)
 OSType: linux
 Architecture: aarch64
 CPUs: 5
 Total Memory: 2.825GiB
 Name: fedora
 ID: CSMT:V43O:SGWG:4B46:ZSWV:KGEA:GGMU:ZPEL:QWLF:35P4:WYEN:675U
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: mageekguy
 Experimental: false
 Insecure Registries:
  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