Variable substitution in .env file for docker run --env-file

Viewed 928

I have an env file like following

examples.env

A="/path1"
B="/path2":$A

Now, I am running docker using following command docker run --env-file=examples.env

This variable $A is not being substituted for value "/path" for variable $B

It becomes "/path2":$A

How can we have $B as /path2:/path1 ?

1 Answers

Write in this way :
A="/path1"
B="/path2":"$A"

Related