Skip to content

cli: honor a leading --help on run and create - #7474

Open
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix-leading-help-run
Open

locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix-leading-help-run

Conversation

@locker95

@locker95 locker95 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

docker --help run hello-world pulls and starts the container. run and create keep a local --help so -h can stay --hostname, and that one shadows the persistent flag once it's already been parsed off.

This prints that command's help instead. docker run --help still works the same way, and --help after the image name is still just an argument.

Fixes #7473

run and create register a local --help so -h can stay --hostname.
That flag shadows the persistent one, and `docker --help run <image>`
went ahead and started the container.

Fixes docker#7473

Signed-off-by: Dean Chen <862469039@qq.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/docker/docker.go 87.50% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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.

docker --help run <image> runs the container instead of printing help

2 participants