Given this docker-compose.yml
which is supposed to print the value of the container’s environment variables containing VIRTUAL_ENV
:
version: '3.8'
services:
test:
image: alpine
environment:
- VIRTUAL_ENV2
- VIRTUAL_ENV1
- VIRTUAL_ENV
command: sh -c 'env | grep VIRTUAL_ENV'
This is the output I receive:
> env VIRTUAL_ENV=foo VIRTUAL_ENV1=foo VIRTUAL_ENV2=foo docker-compose run --rm test
Creating test_run ... done
VIRTUAL_ENV1=foo
VIRTUAL_ENV2=foo
Environment variable VIRTUAL_ENV
is missing. Why is that?