-
Notifications
You must be signed in to change notification settings - Fork 802
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
Shebangs don’t work in heredoc RUN instructions #5251
Comments
I'll check this thanks. |
flouthoc
added a commit
to flouthoc/buildah
that referenced
this issue
Jan 8, 2024
If there are any shebang in heredoc file then buildah must honor that. Consider a case of ```Dockerfile FROM python:3.11-slim-bullseye RUN <<EOF print('hello world') EOF ``` Closes: containers#5251 Signed-off-by: flouthoc <flouthoc.git@gmail.com>
PR #5255 should close this. |
flouthoc
added a commit
to flouthoc/buildah
that referenced
this issue
Jan 12, 2024
If there are any shebang in heredoc file then buildah must honor that. Consider a case of ```Dockerfile FROM python:3.11-slim-bullseye RUN <<EOF print('hello world') EOF ``` Closes: containers#5251 Signed-off-by: flouthoc <flouthoc.git@gmail.com>
TomSweeneyRedHat
pushed a commit
to TomSweeneyRedHat/buildah
that referenced
this issue
Feb 16, 2024
If there are any shebang in heredoc file then buildah must honor that. Consider a case of ```Dockerfile FROM python:3.11-slim-bullseye RUN <<EOF print('hello world') EOF ``` Closes: containers#5251 Signed-off-by: flouthoc <flouthoc.git@gmail.com>
TomSweeneyRedHat
pushed a commit
to TomSweeneyRedHat/buildah
that referenced
this issue
Feb 17, 2024
If there are any shebang in heredoc file then buildah must honor that. Consider a case of ```Dockerfile FROM python:3.11-slim-bullseye RUN <<EOF print('hello world') EOF ``` Closes: containers#5251 Signed-off-by: flouthoc <flouthoc.git@gmail.com> Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Podman/buildah recently got heredoc support for
RUN
instructions, which Docker implemented a couple of years ago. However, it would seem that the feature in Podman is not yet fully compatible with how Docker did it: shebangs such as#!/bin/bash
are not interpreted, and instead theRUN
instruction is executed with the default program (/bin/sh
).As a workaround, the format
RUN /usr/bin/env python <<EOF…
can be used, but I would personally prefer the shebang syntax instead.Steps to reproduce the issue:
RUN
instruction using the heredoc syntax and a shebang. For example:test.containerfile
:podman build --file test.containerfile
Describe the results you received:
The build fails. I think Podman is trying to run the Python program with
/bin/sh
:Describe the results you expected:
The build should succeed. The shebang should be interpreted properly and the
print
line should be fed to Python.Here’s a successful example output when building the same containerfile using Docker.
Show/hide output of
docker build --progress plain --file test.Containerfile .
Output of
podman version
if reporting apodman build
issue:Output of
cat /etc/*release
:Show/hide
Output of
uname -a
:Output of
cat /etc/containers/storage.conf
:Show/hide
The text was updated successfully, but these errors were encountered: