Initialize container volumes with local files
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8
- Forks
- 2
- Avg merge
- 13h 26m
- Merged PRs (30d)
- 35
Description
Context
Oftentimes, container deployments might need to be initialized with a certain set of local files.
Common examples include application-specific configuration files.
Currently, providing these files (especially in a freshly initialized project) is cumbersome, and consists of the following steps:
- Provide an empty dummy app or container (e.g. static file app, or a busybox container)
- Connect to that app, synchronize files (rsync or scp) into the project's
/filesdirectory or into a volume - Then mount that directory into the actual container.
- Remove the temporary dummy app/container
Proposal
Imperative workflow (using container run)
Proposal: Add an additional volume mirror command that initializes a new volume that is automatically initialized from a local directory (alternatively, add a --initialize-from flag to the volume create command:
# alternative #1
user@local $ mw volume create config
user@local $ mw volume mirror ./config config
# alternative #2
user@local $ mw volume create --initialize-from=./config config
# usage
user@local $ mw container run -v config:/etc/config [...]
Declarative workflow (using stack deploy)
Proposal: Use docker-compose syntax (combined with a custom driver) to configure volume initialization:
volumes:
config:
driver: local-sync
driver_opts:
source: ./config
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 by reviewing the existing volume create, volume mirror, and stack deploy command entry points. Compare the two proposed workflows and define the supported initialization behavior and completion checks before implementation; the issue does not name files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, typescript
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100