Fixed regression in docker-based build handling
It doesn't make sense to run pre-build hooks for docker-based builds