I've seen How do I make a comment in a Dockerfile?, and it doesn't answer this question.
The Docker documentation are ambiguous regarding location of the hash in a Dockerfile:
Docker treats lines that begin with # as a comment
It's not clear whether whitespace before the hash is allowed. My testing seems to indicate that it is allowed, but I'm looking for a definitive answer.
The same page is unambiguous about location of the hash in a .dockerignore
file:
If a line in .dockerignore file starts with # in column 1, then this line is considered as a comment and is ignored before interpreted by the CLI.
The lack of ambiguity there would seem to imply the same does not apply to Dockerfile comments.