zbm-builder.sh: Use -d for custom container CLI#808
zbm-builder.sh: Use -d for custom container CLI#808noelleleigh wants to merge 4 commits intozbm-dev:masterfrom
Conversation
This PR changes the `-d` argument of `zbm-builder.sh` to accept an executable argument, which will be used in place of `podman` or `docker`. The container-building docs have been updated to mention the ability to use a `docker`-compatible CLI. For example, to run the script using [nerdctl][0]: ```shell ./zbm-builder.sh -d nerdctl ``` The choice of container CLI follows this priority list: 1. `-d` argument 2. `PODMAN` variable in `zbm-builder.conf` 3. `podman` 4. `docker` Specifying the `PODMAN` variable with `env` isn't supported, because the value would be overwritten by the value from `zbm-builder.conf` when it gets sourced. [0]: https://github.com/containerd/nerdctl
ahesford
left a comment
There was a problem hiding this comment.
I'm vacillating between wanting to see this change respect $PODMAN in the environment and not really caring. We could guard the current default assignment with if [ -z "${PODMAN}" ] and move it right after the configuration file is sourced (and right before the second option parsing) and get this for free. On the other hand, one could just do
zbm-builder.sh -d "${PODMAN}"
and be done.
If you are inclined to make this change, I'll accept it; if not, I won't bother adding it independently.
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
I tried this while implementing this feature, and it didn't work the way I wanted. To me, this is the ideal order of precedence for controlling this setting:
However, to allow Given that, do you still think it's worth adding the extra logic required for supporting |
This PR changes the
-dargument ofzbm-builder.shto accept an executable argument, which will be used in place ofpodmanordocker. The container-building docs have been updated to mention the ability to use adocker-compatible CLI.For example, to run the script using nerdctl:
The choice of container CLI follows this priority list:
-dargumentPODMANvariable inzbm-builder.confpodmandockerSpecifying the
PODMANvariable withenvisn't supported, because the value would be overwritten by the value fromzbm-builder.confwhen it gets sourced.