cmd/create: add --volume option to allow mounting host directories#1809
cmd/create: add --volume option to allow mounting host directories#1809isiin wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for custom volumes in Toolbx containers via a new --volume flag on the create command. It updates the CLI flags, container creation logic, documentation, and adds a system test. The feedback suggests using StringArrayVar instead of StringArrayVarP for the --volume flag since it does not have a shorthand character, which aligns better with the codebase's existing style.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| flags.StringArrayVarP(&createFlags.volume, | ||
| "volume", | ||
| "", | ||
| []string{}, | ||
| "Bind mount a volume into the Toolbx container") |
There was a problem hiding this comment.
Since the --volume flag does not have a shorthand character, it is more idiomatic and consistent with the rest of the file (such as the --authfile flag on line 79) to use StringArrayVar instead of StringArrayVarP with an empty shorthand string.
flags.StringArrayVar(&createFlags.volume,
"volume",
[]string{},
"Bind mount a volume into the Toolbx container")References
- Prioritize consistency with the existing code style over minor refactorings like inlining variables, especially when the current pattern is used throughout the codebase.
1ee3486 to
8479421
Compare
Allow mounting host directories into Toolbx containers. This option provides a way to integrate specialized host-side environments (such as Nix or custom developer toolchains) without sacrificing the container's integrity or modifying shell configuration files. Fixes: containers#1600 - cmd/create: Add --volume option to 'toolbox create' - doc/toolbox.create.1.md: Update man page to document the new option and provide usage guidance and safety warnings. - system/101-create.bats: Add a test for create with --volume option Signed-off-by: isiin <isiin@abeam.ocn.ne.jp> containers#1809
Per feedback on code style consistency, I have introduced '-V' as the shorthand for '--volume'. This justifies the use of StringArrayVarP and improves user experience by providing a consistent CLI interface. Signed-off-by: isiin <isiin@abeam.ocn.ne.jp> containers#1809
8479421 to
0b1c2df
Compare
Per feedback on code style consistency, I have introduced '-V' as the shorthand for '--volume'. This justifies the use of StringArrayVarP and improves user experience by providing a consistent CLI interface. Signed-off-by: isiin <isiin@abeam.ocn.ne.jp> containers#1809
0b1c2df to
9225c80
Compare
Per feedback on code style consistency, I have introduced '-V' as the shorthand for '--volume'. This justifies the use of StringArrayVarP and improves user experience by providing a consistent CLI interface. Signed-off-by: isiin <isiin@abeam.ocn.ne.jp> containers#1809
9225c80 to
0155b8f
Compare
Per feedback on code style consistency, I have introduced '-V' as the shorthand for '--volume'. This justifies the use of StringArrayVarP and improves user experience by providing a consistent CLI interface. Signed-off-by: isiin <isiin@abeam.ocn.ne.jp> containers#1809
0155b8f to
11e858e
Compare
Per feedback on code style consistency, I have introduced '-V' as the shorthand for '--volume'. This justifies the use of StringArrayVarP and improves user experience by providing a consistent CLI interface. Signed-off-by: isiin <isiin@abeam.ocn.ne.jp> containers#1809
11e858e to
497eda3
Compare
|
recheck |
|
recheck |
Allow mounting host directories into Toolbx containers. This option provides
a way to integrate specialized host-side environments (such as Nix or custom developer toolchains) without sacrificing the container's integrity or modifying shell configuration files.
Fixes: #1600
provide usage guidance and safety warnings.