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

Dockerfile heredocs in other RUN-like commands #2170

Open
jedevc opened this issue Jun 12, 2021 · 2 comments
Open

Dockerfile heredocs in other RUN-like commands #2170

jedevc opened this issue Jun 12, 2021 · 2 comments

Comments

@jedevc
Copy link
Member

jedevc commented Jun 12, 2021

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.

@ciaranmcnulty
Copy link

It'd be quite cool for ENTRYPOINT

ENTRYPOINT <<EOF
#! /bin/bash
exec apache2-foreground
EOF

@EatPrilosec
Copy link

EatPrilosec commented Aug 21, 2024

i third this, it also seems like it would help unify shell-form implementation across directives.

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

No branches or pull requests

4 participants