-
Notifications
You must be signed in to change notification settings - Fork 528
Closed
Description
Environment parameters passed with podman-compose run -e KEY=VALUE
are not set in the target container. This is not consistent with behaviour in docker-compose.
docker-compose.yml
version: '3'
services:
env-test:
image: centos:8
command: bash -c "export | grep ZZ"
environment:
- ZZVAR1=python3
docker-compose
Scenario: Override variable already present in docker-compose.yml
Command
docker-compose run -e ZZVAR1=asdf env-test
Result: Environment variable has value specified on command line.
declare -x ZZVAR1="asdf"
Scenario: Add variable not present in docker-compose.yml
Command
docker-compose run -e ZZVAR2=asdf env-test
Result: New value is present in environment.
declare -x ZZVAR1="python3"
declare -x ZZVAR2="asdf"
The above scenarios do not work when using podman-compose. It looks like the parameters are missing from the generated podman command
[gems@centos8 ~]$ podman-compose run -e ZZVAR1="MYVAR" env-test
using podman version: podman version 2.0.5
podman pod create --name=gems --share net
Error: error adding pod to state: name gems is in use: pod already exists
125
Namespace(T=False, cnt_command=[], command='run', detach=False, dry_run=False, e=['ZZVAR1=MYVAR'], entrypoint=None, file=['docker-compose.yml'], label=None, name=None, no_ansi=False, no_cleanup=False, no_deps=False, podman_path='podman', project_name=None, publish=None, rm=False, service='env-test', service_ports=False, transform_policy='1podfw', user=None, volume=None, workdir=None)
podman run -i --name=gems_env-test_tmp12880 --pod=gems --label io.podman.compose.config-hash=123 --label io.podman.compose.project=gems --label io.podman.compose.version=0.0.1 --label com.docker.compose.container-number=1 --label com.docker.compose.service=env-test -e ZZVAR1=python3 --add-host env-test:127.0.0.1 --add-host gems_env-test_1:127.0.0.1 --tty centos:8 bash -c export | grep ZZ
declare -x ZZVAR1="python3"
0
[gems@centos8 ~]$ podman-compose run -e ZZVAR2="MYVAR" env-test
using podman version: podman version 2.0.5
podman pod create --name=gems --share net
Error: error adding pod to state: name gems is in use: pod already exists
125
Namespace(T=False, cnt_command=[], command='run', detach=False, dry_run=False, e=['ZZVAR2=MYVAR'], entrypoint=None, file=['docker-compose.yml'], label=None, name=None, no_ansi=False, no_cleanup=False, no_deps=False, podman_path='podman', project_name=None, publish=None, rm=False, service='env-test', service_ports=False, transform_policy='1podfw', user=None, volume=None, workdir=None)
podman run -i --name=gems_env-test_tmp36351 --pod=gems --label io.podman.compose.config-hash=123 --label io.podman.compose.project=gems --label io.podman.compose.version=0.0.1 --label com.docker.compose.container-number=1 --label com.docker.compose.service=env-test -e ZZVAR1=python3 --add-host env-test:127.0.0.1 --add-host gems_env-test_1:127.0.0.1 --tty centos:8 bash -c export | grep ZZ
declare -x ZZVAR1="python3"
0
septatrix and matevz
Metadata
Metadata
Assignees
Labels
No labels