I have container A that has an environment variable called VAR1 set.
If I do
docker-compose exec A env
I get the result
VAR1=VALUE1
Now, I need to pass this VALUE1 to another command (lets call this as command1) in the same container, and I tried the following:
docker-compose exec A command1 $VAR1
Unfortunately, $VAR1 is evaluated in the local machine in which this command is run (remember this environment variable is set only inside container A).
How do I pass on specific container environment variables to commands that I run through docker-compose exec?