Allow setting AutoRemove (`--rm`) by default in `config.json`
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Description
As a user, i'd like to be able to set something like "autoRemove": true in my ~/.docker/config.json file, so that i can run a command as follows:
docker run -it debian
...and have it be equivalent to:
docker run --rm -it debian
Because i always forget the --rm flag, and end up with hundreds of dangling containers in my Docker dashboard.
I'm not proposing changing the default, just allowing me a persistent way to set the flag. I've had a look at the source and i don't believe there's any environment variable that i could set that would have this effect.
I'll open a small PR that enables the feature i suggest, but i'm sure it won't be ready as-is, because i'll have forgotten cases or whatever, but i'd like to have a starting point for the discussion.
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
No files or tests are named. Start by tracing the Docker CLI's run command and its ~/.docker/config.json loading, then determine where a persistent --rm setting would apply. Done means "autoRemove": true makes docker run -it debian equivalent to docker run --rm -it debian without changing the default for other users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100