1

On my host machine I run the following:

export test_1="Hello"
export test_2="There"

Starting Docker container:

docker run -it -e test* centos 

The env variables are not available in the container. Is what I'm trying to achieve possible?

1 Answer 1

1

You can try to filter your environment variables like

env | grep ^test > env.list

and then use env-file docker option to pass all variables at once:

docker run -it --env-file env.list centos
1
  • That's what I ended up doing, gets the job done. thanks!
    – SimpleNiko
    Oct 17, 2021 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .