-
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
Heredoc notation doesn't work #3474
Comments
A friendly reminder that this issue had no activity for 30 days. |
I tried this with Docker, and it fails?
|
It's a labs (experimental?) feature. |
Ok But this still breaks on docker buildx build at least in the version of Docker i have installed.
|
|
My understanding is that this requires the correct |
Yup that works.
Do you think we should support it? |
Yeah, but I'm not working on the patches yet. |
A friendly reminder that this issue had no activity for 30 days. |
@flouthoc PTAL. |
A friendly reminder that this issue had no activity for 30 days. |
@flouthoc Did you ever get a chance to look at this? |
I'll check this thanks. |
A friendly reminder that this issue had no activity for 30 days. |
@flouthoc any progress? |
Ackd. Not yet, will start working on this. |
Meanwhile it's supported by default by BuildKit >= v0.10.1. |
Any ETA for when this might be resolved? |
I am sure PRs would help move it along. :^) I don't believe anyone has looked at this yet. |
Also impacted by this issue |
Waiting for this. |
I already have somewhat working code for this I'll open a draft PR soon. |
Great, and for those complaining and stating that they are waiting... The best way to get a feature into an opensource project is to roll up ones sleeves and create a PR. |
+1 heredoc would be great. If anyone lands here and finds themselves needing an alternate approach / workaround there are a few angles of attack. The following example is not as elegant as heredoc but I can confirm it's working with podman 4.3.1: RUN echo '#!/usr/bin/env bash\n\
# example \n\
echo "hello world"' > /path/to/file.sh |
Is this feature still not released? I tried to use this today and it was after reading an article from july 2021 |
Greetings! On the Docker website, it's now under Here-Documents / Creating inline files, and requires adding this line at the top of the # syntax=docker/dockerfile:1 I just thought the syntax was cleaner than something like: FROM alpine
RUN mkdir /app && echo -e "\
echo hello \${FOO}\n\
" > /app/script.sh
RUN FOO=abc ash /app/script.sh |
Is this available via the REST API as well?
This generates an error for apt-get Note that this runs via. docker build . |
I'm hoping that there is some movement on this soon. It would really be useful. |
I should be ready with a PR soon, I have early infrastructure for this on the branches flouthoc/imagebuilder@000f471 , https://github.com/flouthoc/imagebuilder/tree/heredoc and https://github.com/flouthoc/buildah/tree/heredoc-experiment |
Okay my branch https://github.com/flouthoc/buildah/tree/heredoc-experiment and most recent commit i.e flouthoc@270f3f9 has a working version with A tryout Containerfile could be FROM ubuntu:20.04
RUN <<EOF
echo "Hello" >> /hello
echo "World!" >> /hello
EOF
RUN ls -a
RUN cat hello I will open a PR in coming days once i gets a ack on design from maintainers. Thanks |
@flouthoc maybe the best way to get the ack is to open the PR? |
DOCKER_BUILDKIT=1 docker build . |
@flouthoc THis is rising in importance since Podman-desktop needs this. |
And FWIW, Mark Russel and I were talking about this yesterday. It would be good if we can squeeze this into 4.8. |
This feature is merged into upstream via #5092 and will be included in next release. |
This is in Buildah v1.33.0 and above, FWIW |
Description
Heredoc notation is supported in Dockerfile syntax, however buildah doesn't handle it correctly.
Steps to reproduce the issue:
1.Create a Dockerfile with the following content:
2.Run
podman build -t tst .
Describe the results you received:
Describe the results you expected:
The image should build and have a file
/tmp/hello
that containhello world
.Output of
rpm -q buildah
orapt list buildah
:-
Output of
buildah version
:-
Output of
podman version
if reporting apodman build
issue:Output of
cat /etc/*release
:Output of
uname -a
:Output of
cat /etc/containers/storage.conf
:The text was updated successfully, but these errors were encountered: