Providing shell to heredoc causes backticks in comments to be run
Perhaps I'm doing something silly here, but when I build the following:
FROM ubuntu
RUN <<-EOF /bin/bash
# `command_not_found`
echo true
EOF
I get output clearly showing that command_not_found was attempted to be run.
$ buildah build
STEP 1/2: FROM ubuntu
STEP 2/2: RUN <<-EOF /bin/bash (# `command_not_found`...)
/bin/sh: 1: command_not_found: not found
true
COMMIT
Getting image source signatures
Copying blob 4b7c01ed0534 skipped: already exists
Copying blob e55fa0c2935e done |
Copying config 883def037e done |
Writing manifest to image destination
--> 883def037e6f
883def037e6faea3b6058034300d437fe97249d151a8ee992ed1ba6c552ec975
This can have pretty severely unintended consequences. I will note that docker build does not seem to do this.
This is tested on the latest main buildah.
@staticfloat RUN <<-EOF /bin/bash (# command_not_found...) just shows that following RUN instruction is a heredoc and it shows summary for first few lines. I think buildkit does it as well ?
A friendly reminder that this issue had no activity for 30 days.
Sorry for the late reply, this got lost in my inbox.
The issue is not with the line:
STEP 2/2: RUN <<-EOF /bin/bash (# `command_not_found`...)
but rather the line underneath that:
/bin/sh: 1: command_not_found: not found