LONDON — Two days after Prime Minister Boris Johnson imposed a lockdown on Britain to curb the spread of the coronavirus, the government has recruited an army of more than 400,000 volunteers to help elderly people quarantined in their homes, as well as the beleaguered public health system.

The recruiting drive, which drew nearly twice its goal in less than 24 hours, was one of several rays of hope in a country that has been girding itself for an onslaught of infections. Officials also expressed guarded optimism that the National Health Service could cope with the flood of patients now that Britain has adopted the sweeping social-distancing measures of other European countries.

“This is going to be a close-run thing,” Chris Whitty, the country’s chief medical officer, said at a Downing Street news conference with Mr. Johnson. “This gap will probably be manageable by the N.H.S., but we can’t guarantee that.”

The statement was a striking turnaround from last week, when officials and outside experts warned that Britain was on a course to be the next Italy, with a growing number of cases that would hopelessly swamp hospitals. It was also evidence that Britain, which only grudgingly accepted the isolation measures of Italy, France and Spain, was pulling together to meet a national challenge.