Changes in .env are not reflected immediately
Describe the bug Not sure if this is expected behavior or not but changes made in .env file are not reflected immediately like they do with docker-compose
To Reproduce Steps to reproduce the behavior:
❯ cat Dockerfile
from busybox
entrypoint ["sh","-c","env"]
❯ podman image build . -t noiceimg
❯ cat docker-compose.yml
services:
noiceservice:
image: noiceimg
environment:
f1: $F1
with docker compose, changes made in .env file are immediately reflected each time when I do docker-compose up but with podman-compose up they are not changed.
I have to do podman-compose down and then again podman-compose up for to .env to take effect
Expected behavior similar to docker-compose. environment variable in container are changed with respect to variables in .env file on host
Actual behavior
each time, I have to do podman-compose down for to .env file to take effect
❯ podman-compose version
['podman', '--version', '']
using podman version: 3.4.4
podman-composer version 1.0.3
podman --version
podman version 3.4.4
exit code: 0
**Environment:**
- OS: ArchLinux
- podman version 3.4.4
- podman-composer version 1.0.3 (installed from arch's repo)
it's not about .env
same dockerfile with the following docker-compose.yml
services:
noiceservice:
build: .
image: noiceimg
environment:
f1: $F1
tested like this
$ echo "F1=4" > .env
$ docker-compose up
Recreating envtest_noiceservice_1 ... done
Attaching to envtest_noiceservice_1
noiceservice_1 | HOSTNAME=31bb3e70916b
noiceservice_1 | SHLVL=1
noiceservice_1 | HOME=/root
noiceservice_1 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
noiceservice_1 | f1=4
noiceservice_1 | PWD=/
envtest_noiceservice_1 exited with code 0
each time you touch the env, the hash changes which triggers Recreating
Recreating envtest_noiceservice_1 ... done
currently we don't recreate. we should implement recreate.
the latest push tracks the checksum of the compose yaml it's now possible to detect changes and recreate containers.
Hello @muayyad-alsadi,
this indeed works as expected for environment variables defined in .yml files, however changes to an env_file are not detected and containers are not recreated
env_file:
- .env-docker-app
@maromcik Please open a new issue and give the exact details of the problem so it can be resolved.