Skip to content
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

Heredocs (<<EOF) syntax in samples doesn't work on Windows when using default Git line ending settings #5402

Open
lbussell opened this issue Apr 25, 2024 · 3 comments

Comments

@lbussell
Copy link
Contributor

lbussell commented Apr 25, 2024

RUN <<EOF
dpkg --add-architecture amd64
apt-get update
apt-get install -y clang zlib1g-dev zlib1g-dev:amd64 gcc-x86-64-linux-gnu llvm
EOF

  1. This syntax is only used in the releasesapi samples and isn't consistent with our other samples.
  2. This syntax does not work on Windows when using Git's default "checkout with CRLF, commit LF" setting.

Proposal: Remove heredocs in samples or provide a note about this in the samples README.

Workaround: Switch the file to LF line endings using your editor before building the sample.

@richlander
Copy link
Member

I'm happy with any option. I noticed that this worked poorly on Windows when I made it was too stubborn to relent. Such surprising behavior for me.

@lbussell
Copy link
Contributor Author

Here's the issue for that - moby/buildkit#4282

@lbussell
Copy link
Contributor Author

lbussell commented May 2, 2024

[Triage] Another option is to specify the line ending for these files specifically with the .gitattributes file - e.g. https://stackoverflow.com/a/40821931

However, this could blow up if a user copies this to their repo and doesn't include the gitattributes. Since this doesn't provide a ton of value, we should just remove the Heredocs.

@lbussell lbussell removed the untriaged label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Current Release
Development

No branches or pull requests

2 participants