fix(compose): support the entrypoint field in service definitions - #85
Open
itxtoledo wants to merge 1 commit into
Open
fix(compose): support the entrypoint field in service definitions#85itxtoledo wants to merge 1 commit into
itxtoledo wants to merge 1 commit into
Conversation
Docker Compose's `entrypoint:` was never parsed, so services relying on it (e.g. `["/bin/sh", "-c"]`) launched with a mangled argv or failed to start. Apple's `container` runtime only accepts a single executable via `--entrypoint`, so the first entrypoint element now becomes the executable and the remaining elements are spliced ahead of the command args, mirroring Docker's ENTRYPOINT + CMD concatenation. `mocker run`, `create`, and `compose run` `--entrypoint` values are split on spaces too, matching Docker's shell-form semantics. 💘 Generated with Crush Assisted-by: Crush:deepseek-v4-flash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docker Compose's
entrypoint:field was entirely ignored:ComposeServicenever parsed it, so any service relying on an entrypoint (e.g.entrypoint: ["/bin/sh", "-c"]) either launched with a mangled argv or failed to start withfailed to find target executable ....Apple's
containerCLI only accepts a single executable via--entrypoint <cmd>— a value with spaces like/bin/sh -cis treated as one executable path and fails to launch. This PR makes mocker mirror Docker's exec model (ENTRYPOINT [...] + CMD [...]concatenation) within that constraint.Changes
ComposeFile: parseentrypoint:(list and shell/string form), include it in multi-file merge and in the config hash so containers are recreated when it changes.ComposeOrchestrator: new pure helperresolveExec(entrypoint:command:)— the first entrypoint element becomes the--entrypointexecutable and remaining elements are spliced ahead of the command argv.run/create/compose run:--entrypointvalues are now split on spaces (Docker shell-form semantics) and routed through the same helper, somocker run --entrypoint "/bin/sh -c"works.resolveExecunit tests. Full suite: 453 tests pass.Verification
Built locally and ran:
mocker compose up -d+ logs →COMPOSE_ENTRYPOINT_FIXED, container stays up.mocker run --entrypoint "/bin/sh -c" alpine echo RUN_EP_FLAG_FIXED→ works (previously errored).💘 Generated with Crush