You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Podman compose does not correctly handle variable substitution with default values or error messages that themselves contain variable substitutions.
To Reproduce
Steps to reproduce the behavior:
Use the following sample files:
Dockerfile:
FROM registry.hub.docker.com/library/busybox:1.37.0-glibc
ARG LINE1
ARG LINE2
ARG LINE3
RUN <<EOF
echo ${LINE1}
echo ${LINE2}
echo ${LINE3}
EOF
compose.yaml:
services:
service:
build:
dockerfile: Dockerfileargs:
LINE1: "value of $$variable_1: $variable_1"LINE2: "value of $$variable_2: $variable_2"LINE3: "value of $${variable_1:-$${variable_2}}: ${variable_1:-${variable_2}}"
Run the following commands:
variable_1=foo podman compose build
variable_2=bar podman compose build
Expected behavior
The output of the third echo should end in:
for variable_1=foo: foo
for variable_2=bar: bar
Actual behavior
The relevant lines end with:
for variable_1=foo: foo}
for variable_2=bar: ${variable_2}
Output
$ podman compose version
>>>> Executing external compose provider "/run/current-system/sw/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<
podman-compose version 1.2.0
podman version 5.2.3
$ variable_1=foo podman compose build --no-cache
>>>> Executing external compose provider "/run/current-system/sw/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<
STEP 1/5: FROM registry.hub.docker.com/library/busybox:1.37.0-glibc
STEP 2/5: ARG LINE1
--> 330d7d829840
STEP 3/5: ARG LINE2
--> 4821dfb5862e
STEP 4/5: ARG LINE3
--> b5022f8e7e7f
STEP 5/5: RUN <<EOF (echo ${LINE1}...)
value of $variable_1: foo
value of $variable_2:
value of ${variable_1:-${variable_2}}: foo}
COMMIT goal-tree-rl_service
--> e305b923d654
Successfully tagged localhost/goal-tree-rl_service:latest
e305b923d654d30bacca9c10fb1d01501a799fbe86ceaf6571d0cd187b40e737
$ variable_2=bar podman compose build --no-cache
>>>> Executing external compose provider "/run/current-system/sw/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<
STEP 1/5: FROM registry.hub.docker.com/library/busybox:1.37.0-glibc
STEP 2/5: ARG LINE1
--> c8fbf7102206
STEP 3/5: ARG LINE2
--> c06fd0ab1eec
STEP 4/5: ARG LINE3
--> 3e9b51fe4501
STEP 5/5: RUN <<EOF (echo ${LINE1}...)
value of $variable_1:
value of $variable_2: bar
value of ${variable_1:-${variable_2}}: ${variable_2}
COMMIT goal-tree-rl_service
--> 77bdcc77f708
Successfully tagged localhost/goal-tree-rl_service:latest
77bdcc77f7081eeb79ebb78fbd5e7d6cbb01a2ee13718ef95efd1ff7f62ed684
Environment:
OS: NixOS 24.11.20241023.2768c7d (Vicuna), Linux 6.11.5
podman version: podman version 5.2.3
podman compose version: git ref unknown; displays as 1.2.0
Describe the bug
Podman compose does not correctly handle variable substitution with default values or error messages that themselves contain variable substitutions.
To Reproduce
Steps to reproduce the behavior:
Dockerfile
:compose.yaml
:variable_1=foo podman compose build
variable_2=bar podman compose build
Expected behavior
The output of the third
echo
should end in:variable_1=foo
:foo
variable_2=bar
:bar
Actual behavior
The relevant lines end with:
variable_1=foo
:foo}
variable_2=bar
:${variable_2}
Output
Environment:
Additional context
Relevant section of Compose file specification: https://github.com/compose-spec/compose-spec/blob/main/12-interpolation.md
The text was updated successfully, but these errors were encountered: