moby / moby/buildkit

Dockerfile heredocs in other RUN-like commands

Open
#2,170 2 comments 1 reaction 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.