Where you can see in 1 root 0:00 /bin/sh -c #!/usr/bin/env bash ps | grep $$ output that the shell used is /bin/sh (not bash, as specified in the shebang #!/usr/bin/env bash).
As a side note, I also checked that the heredoc tab strip is really done so it looks like the issue is that the shebang is checked before the heredoc tab strip is done.
Looks like shebang is not respected on
RUN
command if you have a heredoc with tabs strippedIf I have (heredoc without tab strip):
Dockerfile.ok
I can run:
And I get something like:
Where you can see in
1 root 0:00 bash /dev/pipes/EOT
output that the shell used isbash
.On the other hand, If I have (heredoc with tab strip):
Dockerfile.ko
I can run:
And I get something like:
Where you can see in
1 root 0:00 /bin/sh -c #!/usr/bin/env bash ps | grep $$
output that the shell used is/bin/sh
(not bash, as specified in the shebang#!/usr/bin/env bash
).As a side note, I also checked that the heredoc tab strip is really done so it looks like the issue is that the shebang is checked before the heredoc tab strip is done.