Docker CLI should use mount API for --tmpfs
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
This is a follow-up to https://github.com/moby/moby/pull/35467#issuecomment-345036525
The --tmpfs option adds tmpfs mounts to a container. This option is currently handled daemon-side, where mounts specified through --tmpfs are merged with the default mounts, mounts from -v / --volume, and mounts specified through --mount.
We should change the CLI to use the Mount API
- The mount API was added in API 1.25 (Docker 1.13), added through https://github.com/moby/moby/pull/22373, https://github.com/moby/moby/pull/26837, so can be used on any supported version of Docker (both CE and EE). For older daemons/API versions, the CLI should still use the old options.
- Effectively,
--tmpfsbecomes an "alias" for--mount type=tmpfs ....
Question
- Should we do the same for
--shm-size? - If we do; where are the defaults set? i.e., we likely don't want the CLI to be aware of any defaults set by the daemon for
/dev/shm; how can we provide a custom--shm-size, but keep other defaults as-is?
ping @kolyshkin @cpuguy83 @AkihiroSuda PTAL
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 with the Docker CLI handling for --tmpfs, the Mount API version-history entry for API 1.25, and the referenced pull requests. Define how --tmpfs maps to --mount type=tmpfs while preserving the fallback for older daemons; resolve whether --shm-size belongs in the same change and how daemon defaults remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100