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
/files directory 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
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:
/filesdirectory or into a volumeProposal
Imperative workflow (using
container run)Proposal: Add an additional
volume mirrorcommand that initializes a new volume that is automatically initialized from a local directory (alternatively, add a--initialize-fromflag to thevolume createcommand:Declarative workflow (using
stack deploy)Proposal: Use docker-compose syntax (combined with a custom driver) to configure volume initialization: