Skip to content

[BUG] profiles does not affect ps #11737

Description

@miranyx

Description

When working with profiles, I run --profile NAME ps I expect to only get the output of the specific services regarding their status.

Currently:
Running --profile NAME ps gives every containers status back which are specified in the docker compose file.

Expected:
Running --profile NAME ps gives only the status of the containers back which are in that service group.

Steps To Reproduce

  1. Use this docker compose, the services are only chosen so they do not imminently quit.
services:
  alpine-1:
    image: alpine
    command: /bin/sh -c "while true; do sleep 3600; done"
    profiles:
      - test1

  alpine-2:
    image: alpine
    command: /bin/sh -c "while true; do sleep 3600; done"
    profiles:
      - test2
  1. Run docker compose --profile test2 --profile test1 up -d
  2. Run docker compose --profile test1 ps

Compose Version

Docker Compose version v2.25.0

I don't have the docker-compose program installed.

Docker Environment

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

Server:
 Containers: 91
  Running: 70
  Paused: 0
  Stopped: 21
 Images: 95
 Server Version: 26.0.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  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 splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-18-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 30.91GiB
 Name: nuc
 ID: 8a5be3d2-0759-44bb-b000-aeba62cf7b51
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions