Enhancement: Volume mode for files not directories
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
If you want to mount a single config file into a container, you might use
-v $(pwd)/nginx.conf:/etc/nginx/conf.d/site.conf:ro
If nginx.conf does not exist, it will be created as a directory on the host, and probably raise an error:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
It would be useful if there were a way to indicate that the volume refers to a single file. For example:
-v $(pwd)/nginx.conf:/etc/nginx/conf.d/site.conf:fro
^-- for file
In this example, :f or :frw would indicate a read-write file, and :fro would indicate read-only. If :fro is used and the file doesn't exist, it would raise an error.
There should also be corresponding syntax for VOLUME and a long syntax flag for Docker Compose files.
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 source files, tests, or entry points are named in the issue. Trace volume-option parsing in the CLI first; completion would cover the proposed file-mode syntax, its missing-file behavior, and corresponding VOLUME and Compose forms, with tests for each.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, go
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100