fix: add --name and --detach flags to container options parser - #6026
Open
mango766 wants to merge 1 commit into
Open
fix: add --name and --detach flags to container options parser#6026mango766 wants to merge 1 commit into
mango766 wants to merge 1 commit into
Conversation
The container options parser used by service definitions was missing support for the --name and --detach/-d flags, causing workflows with `options: --name my-container` to fail with: Cannot parse container options: '--name my-redis-container': 'unknown flag: --name' These flags are accepted for compatibility with docker create/run but are not used by act, which manages container names and lifecycle internally. This matches how --rm is already handled. Fixes nektos#5929
themavik
reviewed
Mar 23, 2026
themavik
left a comment
There was a problem hiding this comment.
nit: --name and --detach parse but are ignored; anyone expecting docker parity might think the container is actually named or detached鈥攚orth spelling out the no-op in the flag description.
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.
Fixes #5929
Problem
When using
--nameor-din theoptionsfield of service containers (which is valid in GitHub Actions), act fails with:This happens because the container options flag parser in
docker_cli.godoesn't register these flags, so pflag rejects them as unknown.Fix
Added
--nameand--detach/-dto the flag set inaddFlags(). These flags are accepted for compatibility withdocker create/docker runbut the values are not used by act, which manages container names and lifecycle internally. This follows the same pattern as--rm, which is already accepted but unused.Example workflow that now works