Skip to content

Improve Apple container compose compatibility#119

Open
thromel wants to merge 3 commits into
Mcrich23:mainfrom
thromel:fix/apple-container-compose-compat
Open

Improve Apple container compose compatibility#119
thromel wants to merge 3 commits into
Mcrich23:mainfrom
thromel:fix/apple-container-compose-compat

Conversation

@thromel

@thromel thromel commented Jun 25, 2026

Copy link
Copy Markdown

Summary

This improves compatibility with Apple container for several Compose workflows:

  • decode depends_on map form and preserve dependency conditions
  • wait for service_started, service_healthy, and service_completed_successfully
  • parse service networks object form, including aliases
  • emit Apple network alias properties when the linked Apple container command parser supports them, while preserving a warning/skip fallback for Apple Container 1.0.0
  • warn and skip Compose hostname: because Apple container run 1.0.0 does not currently expose a hostname flag; proposed upstream support remains under discussion in Add container run hostname flag apple/container#1811
  • execute supported healthchecks (CMD and CMD-SHELL) with interval/start-period/retry handling
  • create and mount named volumes through native container volume support instead of rewriting them into host paths
  • surface failed detached container run commands as errors, which makes one-shot failures fail compose up

Related issues: #52, #115, #116, #117, and tracker #118.

Apple-side service discovery work is tracked upstream in apple/container#1809. Current upstream PR chain:

Testing

Static/build checks:

git diff --check
swift build
swift test --filter EntrypointCommandTests
swift test --filter Container_Compose_StaticTests --skip WaitForeverCpuTests

The static test command passed 141 tests. WaitForeverCpuTests was skipped because the existing CPU-threshold test is noisy on this machine and unrelated to these changes.

Manual Apple container smoke tests using the locally built Container-Compose binary:

  • one-shot success dependency completes and unblocks dependent startup
  • one-shot failure exits nonzero and fails up -d
  • native named volume persists data and can be read from a separate container run
  • service network object form attaches to the requested network and emits an alias fallback warning against Apple Container 1.0.0
  • passing healthcheck unblocks dependent service startup
  • failing healthcheck prevents dependent service startup
  • service with hostname: emits a warning, does not pass unsupported --hostname, and completes successfully (HOSTNAME_OK logged)

All dynamic test containers, networks, and volumes were cleaned up after the runs.

@thromel thromel force-pushed the fix/apple-container-compose-compat branch from b0b30a4 to 1ee22f2 Compare June 25, 2026 04:36
@thromel thromel marked this pull request as ready for review June 25, 2026 05:58
@thromel thromel changed the title [codex] Improve Apple container compose compatibility Improve Apple container compose compatibility Jun 25, 2026
@thromel thromel force-pushed the fix/apple-container-compose-compat branch from c46f218 to d862ae7 Compare June 26, 2026 19:45
@Cyb3rDudu Cyb3rDudu self-requested a review June 27, 2026 03:23
@Cyb3rDudu Cyb3rDudu self-assigned this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request]: Add network-scoped aliases for container network attachments

2 participants