I wanted to create a docker-compose file, but the following seems to fail:
...
services:
test:
...
volumes:
- ${FOO}:/bar
...
I've read that environment variables are not evaluated in keys, only in values. But since the $FOO is a value, I thought this would work?
This works. You have to declare FOO somewhere to get the result. Following code will work:
caller.sh
#!/bin/sh
export FOO=/home
docker-compose up
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With