Skip to content

up --wait should not wait for one-shot containers #9273

@felipecrs

Description

@felipecrs

Description

I guess the title says all.

Steps to reproduce the issue:

$ cat docker-compose.yaml
version: '3'
services:
  oneshot:
    image: ubuntu
    command: echo 'hello world'
  longrunning:
    image: ubuntu
    depends_on:
      oneshot:
        condition: service_completed_successfully
    command: sleep infinity

$ docker-compose version
Docker Compose version v2.3.3

# Hangs forever
$ docker-compose up --wait
[+] Running 2/2
 ⠿ Container jenkins-agent-dind-oneshot-1      Exited                             0.9s
 ⠿ Container jenkins-agent-dind-longrunning-1  Healthy                            1.4s

Describe the results you received:
It hangs forever, most likely waiting for one-shot containers to be running.

Describe the results you expected:
It should stop waiting once all the long-running services are up (running or healthy).

Additional information you deem important (e.g. issue happens only occasionally):
How can docker-compose detect which services are one-shot and which ones are long-running?

Hm... not sure if it's the best way, but I would say that, if a service is found under any depends_on with condition service_completed_successfully, it can be inferred as one-shot. Otherwise, long-running.

Output of docker compose version:

Above.

Output of docker info:

Not meaningful, I guess.

Additional environment details:

Not meaningful, I guess.

Metadata

Metadata

Assignees

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