Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to mount host volumes #2949

Conversation

maniSbindra
Copy link
Contributor

What does this change

This change adds flag --mount-host-volume for commands like porter install and porter uninstall, which enables making a host file system folder available inside the running container, which executes the action.

For example the following commands makes the host's $HOME/.hostfolder folder available inside the bundle (as read/write mount) at /home/nonroot/.hostfolder .

porter install test-install --mount-host-volume "$HOME/.hostfolder:/home/nonroot/.hostfolder:rw"

Multiple folders may be mounted. Format for adding a mount is <host path>:<container path>[:<option>]. If option is ro or not provided or invalid, then file system is mounted as read only. If option is rw then file system is mounted as read/write inside the container

What issue does it fix

Closes #475

Notes for the reviewer

This works with the docker driver. By default folders are mounted as read only.

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

- Fixes getporter#475
- Add option to mount host volume

Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
@maniSbindra maniSbindra changed the title Manisbindra/add install uninstall local volume mount feature Add feature to mount host volumes for commands like porter install and porter uninstall Oct 23, 2023
@maniSbindra maniSbindra changed the title Add feature to mount host volumes for commands like porter install and porter uninstall Add feature to mount host volumes Oct 23, 2023
Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
@schristoff
Copy link
Member

/azp run porter-integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
@lbergnehr
Copy link
Contributor

This is great! I would suggest, if it's not already there, to also enable mounting through the porter config. That way you vould set up mounts you always want, for example ~/.azure when doing Azure CLI authentication. Would be even more seamless.

@maniSbindra
Copy link
Contributor Author

/azp run porter-integration

Signed-off-by: Maninderjit Bindra <maninder.bindra@gmail.com>
@maniSbindra maniSbindra requested a review from sgettys November 20, 2023 06:58
@schristoff schristoff merged commit 35d7997 into getporter:main Feb 7, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support mounting volumes for install/uninstall commands
4 participants