Open hmontone opened 1 month ago
Behaviour in Docker Compose (as described in documentation) is what I expected.
It seems that if I interpolate value in compose.yml
it picks the value correctly from .env
:
$ cat .env
TEST=test
$ cat compose.yml
services:
test:
image: busybox
environment:
- TEST=$TEST
command: printenv
$ podman compose run --rm test
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
container=podman
TERM=xterm
TEST=test
HOME=/root
HOSTNAME=cb5574ddcaef
On the other hand if I set environment variable as local environment variable then it is replicated correctly:
$ cat .env
TEST=test
$ cat compose.yml
services:
test:
image: busybox
environment:
- TEST
command: printenv
$ TEST=local podman compose run --rm test
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
container=podman
TERM=xterm
TEST=local
HOME=/root
HOSTNAME=481b5794f566
Describe the bug If environment variable value is defined in default
.env
-file and environment variable is replicated incompose.yml
file, environment variable is not passed to containerTo Reproduce
.env
:compose.yml
:Expected behavior Environment variable
TEST
should be included in outputActual behavior Environment variable
TEST
is not included in outputOutput
My environment: