Fix to dockerfiles: git must come earlier