Skip to content

Providing shell to heredoc causes backticks in comments to be run #6044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
staticfloat opened this issue Mar 8, 2025 · 2 comments
Open

Comments

@staticfloat
Copy link

staticfloat commented Mar 8, 2025

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.

@flouthoc
Copy link
Collaborator

flouthoc commented Mar 19, 2025

@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 ?

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants