I'm using most of the standard features of org-mode that come with the spacemacs develop branch, but I haven't been able to find a way to disable the automatic indentation for source code blocks on a case by case basis. I use tangle and I'm writing Dockerfile's in the same file that I'm writing groovy code or javascript for example. The Dockerfile's are the only ones I want not to be indented so I can get syntax highlighting. Here's what it looks like without the indentation:
And here's what it looks like with the indentation that automatically happens if I edit the text:
The automatic indentation is fine for groovy for example, so I have no issue with the automatic indentation here. (in fact, if I still got the syntax highlighting for Dockerfile's I probably wouldn't mind too much except the weird word wrapping not respecting the background face). Here's the example with groovy:
As you can see, I tried a :noindent property I found in the org-mode docs that's usually in a #+STARTUP directive. I also searched stack overflow, but I didn't find anything fruitful that didn't disable indenting for all source blocks or for the entire file.



In my practice (I'm not sure it is a good practice or not, just share it to you):
org-src-tab-acts-nativelytotruefor using the language’s major-mode indentation. In your case, it will format the src block with the formatting rules ofdockerfile-mode.plain-modefor the content which should not be indented automatically. Personally, I use this mode for something like:In this way, the src blocks will always behavior as expected when formatting them.
Aside, the example code of plain-mode: