Rationalize `build` and `hack` directories

This also enables incremental builds for dockerized builds.

Fixes #1729
I don't think `|| { exit 1; }` is needed here, since if it fails it will exit != anyways.