Skip to content

Exit code printed as error when using --exit-code-from #9782

Closed
@mikesir87

Description

@mikesir87

Description

When using the --exit-code-from flag, an error message is output with the status code, giving the impression an error occurred even if the exit code was 0.

Steps to reproduce the issue:

  1. Use the following compose file
    services:
      app:
        image: ubuntu
        command: sleep 1
  2. Start using docker compose up --exit-code-from app

Describe the results you received:

docker compose up --exit-code-from app
[+] Running 1/0
 ⠿ Container compose-app-1  Recreated                                      0.0s
Attaching to compose-app-1
compose-app-1 exited with code 0
Aborting on container exit...
[+] Running 1/0
 ⠿ Container compose-app-1  Stopped                                        0.0s
ERRO[0001] 0

Describe the results you expected:

The same output minus the ERRO[0001] 0 message.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

Docker Compose version v2.9.0

PR incoming (just making the issue first)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions