mittwald / mittwald/cli

Initialize container volumes with local files

Open
#1,666 2 comments 0 reactions 0 assignees View on GitHub

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:

  1. Provide an empty dummy app or container (e.g. static file app, or a busybox container)
  2. Connect to that app, synchronize files (rsync or scp) into the project's /files directory or into a volume
  3. Then mount that directory into the actual container.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.