Re:Dockerfmt: A Dockerfile Formatter
by yjftsjthsd-h on Wednesday April 09, 2025 @12:57AM
(#43628996)
Meta: In HN, prefix a line with 2 spaces to get code formatting, ex.
# syntax=docker/dockerfile:1.3-labs
FROM alpine
RUN <<EOF
echo "This is a heredoc example"
echo "It allows multi-line commands"
EOF
Non-meta: Do you happen to know how portable that is across old docker, podman/buildah, kaniko, etc.? I'd like to adopt it but I don't want it to bite me when I'm not running a recent version of literal docker.
I find it more readable and portable.
[1] https://www.docker.com/blog/introduction-to-heredocs-in-dock...