Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

docker compose ps xxx error behavior changed between v1 and v2 #1893

Description

@kinkerl

Description

It looks like the behavior and exit codes of failure states changed with the docker compose ps command when looking for specific services. Also, the command help text now does not show the service as a potential parameter.

Steps to reproduce the issue:

v1 CLI:

$ /usr/local/bin/docker-compose-old ps IDONTEXIST
ERROR: No such service: IDONTEXIST
$ echo $?
1

$ /usr/local/bin/docker-compose-old ps --help
List containers.

Usage: ps [options] [SERVICE...]

v2 CLI

$ docker compose ps IDONTEXIST
NAME                COMMAND             SERVICE             STATUS              PORTS
$ echo $?
0

$ docker compose ps --help
Usage:  docker compose ps
List containers

Describe the results you received:

We now see no error message and also more importantly, the error code of the command changed to a zero.

Describe the results you expected:

I would assume to get at least the same error code. This change in behavior actually broke our scripts and does not behave like a drop in replacement.

Output of docker version:

v2 CLI

Docker version 20.10.7, build f0df350
Docker Compose version v2.0.0-beta.5

Activity

  1. changed the title [-]docker compose ps -q xxx error behavior changed between v1 and v2[/-] [+]docker compose ps xxx error behavior changed between v1 and v2[/+] on Jul 6, 2021
  2. kinkerl commented on Jul 12, 2021

    @kinkerl
    Author

    ❤️

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityCompatibility with docker-compose

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions