-
Notifications
You must be signed in to change notification settings - Fork 887
Pass multiple host environment variables during buildah run #4688
Copy link
Copy link
Closed
Labels
Good First IssueThis issue would be a good issue for a first time contributor to undertake.This issue would be a good issue for a first time contributor to undertake.locked - please file new issue/PRstale-issue
Description
Description
podman run will pass multiple environment variables from the host to the container when the name passed to --env ends with *:
As a special case, if an environment variable ending in
*is specified without a value, Podman will search the host environment for variables starting with the prefix and will add those variables to the container.
$ export ENV1=a $ podman run --env 'ENV*' alpine env | grep ENV ENV1=a
I have found this very useful for tools that can be configured through the environment. It would be great if buildah run also had this behavior. For example,
$ export TOOL_ONE=1 TOOL_TWO=profit
$ CONTAINER=$(buildah from alpine)
$ buildah run --env 'TOOL_*' "${CONTAINER}" -- env
…
TOOL_ONE=1
TOOL_TWO=profitOutput of buildah version:
buildah version 1.27.3 (image-spec 1.0.2-dev, runtime-spec 1.0.2-dev)
Output of podman version:
podman version 4.2.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good First IssueThis issue would be a good issue for a first time contributor to undertake.This issue would be a good issue for a first time contributor to undertake.locked - please file new issue/PRstale-issue