Dockerfile heredocs in other RUN-like commands
Open
@jedevc is already working on this.
Since Jun 28, 2021.
area/dockerfile
area/frontend
- Dominant language
- Go
- Stars
- 10.3k
- Forks
- 1.5k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 50
Description
Following up on #2132.
Heredocs are now supported in RUN commands - it might be nice to extend this support into other commands that use similar semantics:
For example, CMD:
CMD <<EOF
#!/usr/bin/env python
print("Hello world")
EOF
Similarly for ONBUILD:
ONBUILD RUN <<EOF
echo test
EOF
ONBUILD COPY <<EOF /dest
file contents
EOF
I also imagine the same would work well with HEALTHCHECK? Though I don't have much experience with that specific command.
This is mostly for the sake of consistency with RUN-like commands, but it's not too hard to imagine valid use cases that might call for this feature.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.