I think so too, Oleg Nenashev. Overriding the BUILD_ID environment variable looks very hacky.
Unfortunately there is no possibility for Gradle to run the daemons initially. And of course the daemon feature of Gradle will only make sense for "always-on" build nodes, so using it in combination with docker agents is useless.
That said: Would it be possible (from an architectural point of view) to disable the ProcessTreeKiller for specific builds instead of using this BUILD_ID hack? I think there are enough reasons here to give users the possibility to do so.