Skip to content

Add Compose - #239

Closed
Mcrich23 wants to merge 91 commits into
apple:mainfrom
Mcrich23:add-compose
Closed

Mcrich23 wants to merge 91 commits into
apple:mainfrom
Mcrich23:add-compose

Conversation

@Mcrich23

@Mcrich23 Mcrich23 commented Jun 19, 2025 •

Copy link
Copy Markdown
Contributor

There has been a lot of discussion around a docker-compose counterpart for Container. This moves that discussion a bit further by introducing a basic translation layer for compose.

This pr introduces a new command group into the cli: Compose. It has two subcommands: up and down.

The origin behind this pr being made comes from the desire to run Vapor on Apple Containers. Hopefully, efforts like this make it possible quite soon.

Note: This is an early implementation of compose and there are features missing in Container that makes it not up to complete feature parity. This is bound to change as features such as port customization are introduced.

@Mcrich23 Mcrich23 mentioned this pull request Jun 19, 2025
1 task done
@Mcrich23

Copy link
Copy Markdown
Contributor Author

Referencing the discussions/issues about how best to support compose: #55 #194 #101

@stevenanthonyrevo stevenanthonyrevo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed as much as I can!

I'm fairly limited due to my current MacOS version as anything below 6.2.0 will just error out.

Although, thanks for your work on this feature request as I was really hopeful for such a feature!

So on Good Faith, I'm going to Approve! If anyone else wants to review, feel free!

@Mcrich23

Mcrich23 commented Jul 8, 2025

Copy link
Copy Markdown
Contributor Author

Thank you! I am also planning to add support for the newfound networking capabilities in the coming days.

Also, if anyone knows how to restructure compose to call these commands without invoking the command line, I would be very grateful to hear about it!

@Mcrich23

Mcrich23 commented Jul 8, 2025

Copy link
Copy Markdown
Contributor Author

To address these things before the merge, I am going to make this pull request into a draft. If you want to try the tool compiled, you can get it at https://github.com/mcrich23/Container-Compose.

@Mcrich23
Mcrich23 marked this pull request as draft July 8, 2025 19:28
@jglogan jglogan removed their assignment Sep 8, 2025
Mcrich23 and others added 4 commits September 14, 2025 12:14
* improve compose file not found error message

* support compose.yaml and make usage consistent across up and down

* make compose.yml the default in error message
@TomasLudvik

Copy link
Copy Markdown

@Mcrich23 any progress here? I can see it has been approved last week. Can we move it forward? I am excited to see this feature in next release :)

@ManuW

ManuW commented Nov 1, 2025

Copy link
Copy Markdown

Looks like the compose tool is also available as external tool: container-compose.

An internal tool would be good, but it's not a must. “Docker Compose” also started out as an external tool.
I would close this PR for now and refer to the external version.

@Mcrich23

Mcrich23 commented Nov 1, 2025

Copy link
Copy Markdown
Contributor Author

This PR has remained open to help provide information to the community around building a tool. The other compose pr currently open is way more likely to be merged. But at the moment one of the biggest challenges overall is the desire to do small and incremental PRs for the plugin.

@atovstonog

Copy link
Copy Markdown

@Mcrich23 any updates here?

@Mcrich23

Copy link
Copy Markdown
Contributor Author

@atovstonog If you look above, this PR will not be merged due to the size of the PR. It is staying open to push for others to see the conversation as to how it could be built.

In the meantime, I have made a 3rd party tool called Container-Compose. You can even install it via homebrew!

@adamcee

adamcee commented Mar 12, 2026 •

Copy link
Copy Markdown

Hi all. Appreciate the thoughtful discussion around this. I see there is a third party tool Container-Compose which looks great and which I will be using to get the compose feature with Apple Container.

If possible I'd prefer to have the tool not be third party simply from a dependency management perspective - I installed container as recommended, but currently need to use brew to install container-compose. Let me know if I'm over-thinking this.

But, in that vein, I am trying to read thru the various discussion threads, and it sounds like the issue is the PR size and maybe some elements of the general approach? That the feature set was not minimal enough?

Asking because I'd like to understand this well enough to see if I could take a crack at moving the ball forward on having compose not be a 3rd party lib, if that is still desirable. Either by contributing to this PR or using it as a reference.

If possible could someone summarize:

  • Is there still desire for compose to be internal?
  • At a high level what needs to be done (blockers, etc) to accomplish that as desired?

Or, point me to the thread where that is discussed. There are several related Issues and I was struggling to find the key info.

@jglogan

jglogan commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Closing for now, as we're not considering compose for upstream at this time. Please develop this as an external plugin for now. If you have any questions regarding plugin development (we're still getting docs together) feel free to open a discussion topic!

@arch-fan

arch-fan commented Apr 7, 2026

Copy link
Copy Markdown

What about making Compose a core feature? Or is that not in the plans? I’d be willing to work on an implementation.

@Mcrich23

Mcrich23 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now, as we're not considering compose for upstream at this time. Please develop this as an external plugin for now. If you have any questions regarding plugin development (we're still getting docs together) feel free to open a discussion topic!

Sounds good @jglogan and I am still happy to write those docs. I just feel that it is a waste of time without a way to pass down option groups into subsequent actions.

@luisneto

luisneto commented Apr 8, 2026

Copy link
Copy Markdown

@jglogan : Would it be possible to help us/me understand the reason(s) you are not considering compose for upstream at this time?
Thanks in advance!

@luisneto

luisneto commented Apr 8, 2026 •

Copy link
Copy Markdown

In addition, I'm confused about what's going on here, actually. Your comment says "Closing for now", but this pull request is still open.
What you did close was pull request #1394.

Did you really mean to write that comment here, @jglogan?

@jglogan jglogan closed this Apr 9, 2026
@jglogan

jglogan commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

@luisneto It's discussed to some extent above, and in discussion #194.

Docker Compose is a free-standing project. Its source isn't mingled with Docker Engine, CLI, buildkit, or the SDKs because its concerns are separate from those of the other Docker/Moby ecosystem projects. There's no need to colocate them in one project.

The maintainers of container have limited bandwidth and are focused on the container core functionality at present, trying to refine it and the Containerization library to the point where we can better support plugins for ecosystem integration. Our focus, for now, is on this, and we welcome contributions in this area. We understand the community desire for a Compose-like feature and get that it's frustrating not to have such a key piece of the puzzle (we'd love it too), but upstream in apple/container is not the place for it. @Mcrich23, @mazdak, the socktainer folks, and others are all working hard at this and I'm sure could benefit from contributions as well.

@andrew-waters

andrew-waters commented Sep 16, 2026 •

Copy link
Copy Markdown

@Mcrich23 thanks for keeping this open. The thread is genuinely useful reading for anyone who tries this next, and this is meant as a contribution to that rather than a plug.

I took @jglogan's answer literally and built it as an external plugin: https://compose.andon.dev

For anyone arriving here wondering whether the plugin route is actually viable, it is, and it is worth saying plainly: a binary and a config.toml in the plugin directory and the stock CLI picks it up, so container compose up behaves like any other subcommand without a line of this landing upstream. It builds against released apple/container with no patched runtime. The option-group limitation you raised above is real and is the main thing that still makes a plugin more awkward to write than it should be.

The other thing I would offer back is about structure. The hard part here is not the command surface, it is the parsing and the plan, and that is why each of these efforts keeps rewriting the same two things. In mine that part is three libraries whose only dependency is a YAML parser: they cannot start a container and do not link anything that can, and ContainerAPIClient appears solely in the executable that carries a plan out. So it can be linked on its own. Orchard depends on ComposePlanner directly and never invokes the plugin binary, and anyone building a UI or another CLI could do the same.

Open source, and I would rather the planning layer became something shared than everyone kept writing their own.

@Mcrich23

Copy link
Copy Markdown
Contributor Author

No problem! If you don't mind, I would appreciate it if you could speak more to the OptionGroup problem. I think helping the team at Apple understand the use case can make my PR around it more likely to get merged.

MCF241 pushed a commit to MCF241/promethee that referenced this pull request Sep 24, 2026
…ainer

L'installation manuelle décrite dans documentation/promethee_guide_installation.pdf
comporte une étape délicate — récupérer le GARAGE_NODE_ID que Garage génère
lui-même au premier démarrage — et plusieurs secrets à produire à la main.
install.sh automatise l'ensemble.

Déroulé : avertissement sur le prérequis conteneurs (avec confirmation), choix
du mode, préparation du .env, récupération automatique du Node ID, build et
vérification. Rejouable : relancé, il conserve secrets et clé API déjà en place.

- scripts/container-engine.sh : détection du moteur, partagée avec prom.sh pour
  que les deux scripts s'accordent. Docker (docker compose, repli
  docker-compose), Podman (podman compose, repli podman-compose). Le moteur
  natif d'Apple est accepté en dernier recours : Apple ayant écarté le compose
  natif (apple/container#239) au profit des plugins, la détection teste
  dynamiquement si un plugin compose tiers répond, et prévient que ces
  réimplémentations partielles peuvent ne pas honorer le
  depends_on: condition: service_healthy dont dépend la séquence Garage.
- Refus du repli vers docker-compose v1 : sous Debian, `apt install
  docker-compose` installe la v1, incapable d'interpréter ce fichier compose
  (Compose Specification, service_completed_successfully). La pile aurait échoué
  de façon illisible.
- Contrôle de visibilité du dépôt depuis la machine Podman sur macOS : la VM ne
  monte que le dossier personnel, et un dépôt situé ailleurs produit un
  bind-mount vide de garage.toml — Garage ne démarre alors jamais sans cause
  apparente.
- Variable BIND_ADDRESS : 127.0.0.1 en installation locale, 0.0.0.0 en mode
  serveur. Le défaut de docker-compose.yml reste 0.0.0.0, les déploiements
  existants sont inchangés.
- prom.sh généralisé au moteur détecté (12 appels compose, build direct, prune)
  et passé en mode exécutable, le README documentant son appel par ./prom.sh.
- .gitignore : les sauvegardes .env.bak.<horodatage> produites par --reinstall
  contiennent les anciens secrets et n'étaient couvertes ni par .env ni par *.env.
- tests/test_install.sh : 20 assertions sans dépendance sur la manipulation du
  .env, la génération des secrets, l'extraction du Node ID et le choix du mode.

Co-Authored-By: Claude Opus 5 <[email protected]>
andrew-waters added a commit to andrew-waters/compose that referenced this pull request Oct 13, 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.