containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.15k stars 767 forks source link

HEREDOC: Escaping `$` seems off #5422

Open LecrisUT opened 3 months ago

LecrisUT commented 3 months ago

Description

Let's say we have dockerfile like:

FROM fedora:latest

ENV EXPAND_THIS_VAR=/correctly_expanded
COPY <<EOF /etc/profile.d/load-modules.sh
export MODULEPATH="\$MODULEPATH:$EXPAND_THIS_VAR/lmod"
EOF

CMD cat /etc/profile.d/load-modules.sh

The issue is that the $ sign is not escaped as expected

Describe the results you received:

$ podman run ...
export MODULEPATH="\$MODULEPATH:/correctly_expanded/lmod"

Describe the results you expected:

$ podman run ...
export MODULEPATH="$MODULEPATH:/correctly_expanded/lmod"

Output of podman version if reporting a podman build issue:

Client:       Podman Engine
Version:      4.9.3
API Version:  4.9.3
Go Version:   go1.21.7
Built:        Mon Feb 19 16:41:34 2024
OS/Arch:      linux/amd64
github-actions[bot] commented 2 months ago

A friendly reminder that this issue had no activity for 30 days.

LecrisUT commented 2 months ago

Maybe #5473

github-actions[bot] commented 1 month ago

A friendly reminder that this issue had no activity for 30 days.