Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Upgrade buildkit version and support heredocs syntax #174

Closed
roi-orca opened this issue Nov 5, 2023 · 6 comments
Closed

Upgrade buildkit version and support heredocs syntax #174

roi-orca opened this issue Nov 5, 2023 · 6 comments

Comments

@roi-orca
Copy link

roi-orca commented Nov 5, 2023

Support heredocs syntax and add them to the command output to consume it.
Currently instructions with heredocs syntax break the parsing (added undefined commands to the output)
https://docs.docker.com/engine/reference/builder/#here-documents
https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
Thanks!

@roi-orca
Copy link
Author

@asottile

@asottile
Copy link
Member

@roi-orca

@duaraghav8
Copy link

duaraghav8 commented Oct 8, 2024

@asottile @roi-orca
Hey guys. Thanks for this project, really helpful!

I just ran into this issue myself.
Any plans on resolving this soon? I see an open PR to upgrade buildkit version, so wanted to check if if you're going to be merging soon.

ATM, this ends up parsing the shell commands inside as separate Commands

>>> print(run)
RUN <<EOF
source $HOME/.bashrc && echo $HOME
EOF

>>> t = dockerfile.parse_string(run)

>>> t
(Command(cmd='RUN', sub_cmd=None, json=False, original='RUN <<EOF', start_line=1, end_line=1, flags=(), value=('<<EOF',)), Command(cmd='source', sub_cmd=None, json=False, original='source $HOME/.bashrc && echo $HOME', start_line=2, end_line=2, flags=(), value=('',)), Command(cmd='EOF', sub_cmd=None, json=False, original='EOF', start_line=3, end_line=3, flags=(), value=('',)))

Thanks

@asottile
Copy link
Member

I don't have any plans -- the dependabot PR doesn't really mean anything as it was auto generated. if a test is added and the version is bumped then I can review it and release it but I'm not going to bump the version just to bump it unless there's a demonstrated reason to do so

@sebastian-echeverria
Copy link
Contributor

@asottile I tried to address this issue by updating buildkit, adding some needed functionality to properly parse heredocs, and adding tests for this in PR #202

@asottile
Copy link
Member

archiving the project: closing this out

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

No branches or pull requests

5 participants
@sebastian-echeverria @asottile @duaraghav8 @roi-orca and others