In the simple case, yes it is, but it scales poorly; consider ex.
https://github.com/docker-library/postgres/blob/b9c080857b88... which is
112 lines run together like that to keep things in a single layer. This is pretty bad for readability. Also, as sibling comment notes, that only works for RUN commands, not other or mixed groups of commands.