Command `run` short CLI options `-r` and `-E` (for `--rm` and `--entrypoint` respectively)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Description
Dear Developers,
Thank you very much for the ineffably marvelous project... 🪐
Considering the absence of some short options in usage for command run, I just wanted to clarify the rationale behind it except an safety trait or a protection against a mistake of an accidental container removal.
For instance, what if the call would add the short option alias for --rm as the following?:
flags.BoolVar(&copts.autoRemove, "rm", "r", false, "Automatically remove the container and its associated anonymous volumes when it exits")
This, in turn, would allow to shorten it:
$ # docker run -it --rm -- 'debian:bookworm' bash;
$ docker run -rit -- 'debian:bookworm' bash;
Similarly, short option alias -E for --entrypoint:
flags.StringVar(&copts.entrypoint, "entrypoint", "E", "", "Overwrite the default ENTRYPOINT of the image")
$ # docker run -it --rm --entrypoint '/bin/dash' -- 'debian:bookworm';
$ docker run -ritE '/bin/dash' -- 'debian:bookworm';
Would there be some kind of conflict involved if added?
Best and kind regards ✨
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in cli/command/container/opts.go at the flag definitions for --rm and --entrypoint, as linked in the issue. Check how existing short options are registered and whether r or E conflicts with other docker run options. Done means both aliases work in the shown commands and are represented correctly in the run command's usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100