buildkit
buildkit copied to clipboard
Dockerfile heredocs in other RUN-like commands
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.
It'd be quite cool for ENTRYPOINT
ENTRYPOINT <<EOF
#! /bin/bash
exec apache2-foreground
EOF