The German champions twice hit the woodwork in a furious start before Jerome Boateng headed them into the lead in the 12th minute.