Skip to content

One-shot services are reported as startup timeouts and failures can exit 0 #115

Description

@thromel

Summary

Short-lived services that exit successfully are reported as startup timeouts, and some failed starts still cause container-compose up to exit with status 0.

This makes one-shot Compose jobs and CI usage hard to trust.

Environment

- OS: macOS 26.5.1 (25F80)
- Xcode: 26.5 (17F42)
- container: 1.0.0 (release, commit ee848e3)
- container-compose: 1.0.0 installed via Homebrew
- Architecture: arm64

Reproduction: successful one-shot service

compose.yml:

services:
  cmdonly:
    image: busybox:latest
    command: ["sh", "-c", "echo CMD_OK"]

Run:

container-compose --file compose.yml up -d cmdonly
container list --all | grep cmdonly
container logs feature-isolation-cmdonly

Actual behavior

container-compose reports:

Error Domain=ContainerWait Code=1 "Timed out waiting for container 'feature-isolation-cmdonly' to be running."

But the container actually ran successfully and exited:

feature-isolation-cmdonly  docker.io/library/busybox:latest  linux  arm64  stopped

Logs:

CMD_OK

The same happened for a locally built one-shot image:

build-built  local-compose-build-test:latest  linux  arm64  stopped

Logs:

from-build-arg

Expected behavior

If a service process exits before reaching a long-running running state, container-compose should inspect the exit result:

  • exit code 0: treat as a successful completed one-shot service
  • non-zero exit code: report failure and return a non-zero CLI exit status
  • still booting/running: continue the existing wait behavior

This would match common Compose usage for migration jobs, probes, build checks, and test containers.

Related status-code issue

In a separate named-volume start failure, container-compose up -d printed an internal error but still returned shell exit code 0. That should return non-zero so scripts and CI can detect failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions