News for hackers. Stuff that matters.
Re:Dockerfmt: A Dockerfile Formatter by mcstafford on Wednesday April 09, 2025 @12:54AM (#43628984)
I prefer heredoc[1] syntax.

I find it more readable and portable.

[1] https://www.docker.com/blog/introduction-to-heredocs-in-dock...

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.
Re:Dockerfmt: A Dockerfile Formatter by vbezhenar on Wednesday April 09, 2025 @08:33AM (#43631340)
It is new feature and not portable to old versions. But modern podman supports it. No idea about kaniko.