Truckers are trying to navigate growing challenges on highways and at loading docks as they seek to keep supply chains running to meet surging coronavirus-driven demand for consumer staples and medical equipment.

Truck-stop restaurants in some states have shut dining rooms and switched to takeout service to comply with health orders aimed at controlling the spread of the virus. On Tuesday, Pennsylvania closed its state-run rest stops, cutting back significant parking space along key logistics corridors.

Some customers are asking drivers to stay in their trucks or switch from paper to electronic methods to document pickups and deliveries, trucking companies and freight brokers said. Additionally, some trucking companies said their drivers are facing new restrictions at receiving docks if they have been in states considered coronavirus hot zones.

“Some of the shippers and receivers are asking drivers to sign affidavits that they are not sick,” said Linda Allen, owner of Hardcore Trucking, a trucking company based in Spring Hill, Fla., that hauls refrigerated loads.

“They are not allowed to use the restroom, not allowed to use the building,” Ms. Allen said. “They don’t want drivers in the facilities.”

Related Stranded Trucker Becomes Unlikely Hero of Coronavirus Lockdown

The American Trucking Associations industry group has asked the Trump administration to exempt truckers delivering essential goods from travel and other restrictions aimed at containing the pandemic.

In a letter Tuesday, the group also asked for rest stops to be kept open and for guidance on driver health, including possible testing for Covid-19. “Absent policies like these, it will be more difficult to ensure that the shelves are stocked and emergency supplies reach first responders and medical personnel,” ATA Chief Executive Chris Spear said in the letter.

Trucking capacity is getting tighter as demand surges from retailers and manufacturers hustling to replenish stores and distribution centers cleaned out by shoppers stockpiling food and sanitizing supplies. On Tuesday, the average rate to hire a truck on the spot market, where businesses book last-minute transportation, had increased 6.1% since Feb. 29 to $1.89 per mile including fuel, according to online freight marketplace DAT Solutions LLC.

On Dec. 1, 2019, a patient in Wuhan, China, started showing symptoms of what doctors determined was a new coronavirus. Since then, the virus has spread to infect more than 100,000 people. Here’s how the virus grew to a global pandemic. Photo: Getty Images

Shipments of items such as electronics and health and beauty products are being delayed as retailers make more room in distribution centers and stores for food, paper products and diapers, according to Mac Pinkerton, president of freight broker C.H. Robinson Worldwide Inc.’s North American Surface Transportation division.

“Given the amount of foodstuffs and consumables being purchased, it has created a tremendous amount of disruption across those supply chains,” said Mr. Pinkerton.

Some drivers aren’t willing to haul loads to states such as New York or Washington where the numbers of coronavirus cases are highest “because when they go to other states, they are stopped at the gate and asked where they have been,” said Libby O’Hara, U.S. operations director for Logistics Plus Inc., an Erie, Pa.-based logistics and trucking provider.

Pennsylvania is home to large clusters of warehouses and distribution centers, and serves as a major lane for freight moving through the East Coast and the Midwest. News that Pennsylvania was shutting down its state-run rest stops raised alarms among truckers.

The Owner-Operator Independent Drivers Association asked the Federal Motor Carrier Safety Administration, the main U.S. regulator of trucking operations, to direct states to ensure truck stops would remain open. “For professional drivers, rest areas aren’t simply places to purchase snacks and beverages from vending machines—they are invaluable locations to rest when fatigued,” the group said in a letter Tuesday.

On Wednesday, the Pennsylvania Department of Transportation said it would reopen 13 rest areas by Thursday for truck parking with portable toilets that would be cleaned once a day.

FMCSA recently lifted hourly driving restrictions for truckers hauling critical medical goods and food for emergency restocking of stores in response to the pandemic. On Wednesday, the agency expanded its national emergency declaration to include fuel, paper products and other groceries as well as raw materials such as paper, plastic and alcohol used to manufacture essential items.

Newsletter Sign-up The Logistics Report Top news and in-depth analysis on the world of logistics, from supply chain to transport and technology. PREVIEW

Most major truck-stop chains and many independent truck stops remain open, although some have closed sit-down restaurants and are preparing food for pickup or takeout, said Lisa Mullings, chief executive of NATSO, a trade group for the travel plaza and truck stop industry.

On Tuesday, FMSCA acting administrator Jim Mullen said in a letter to NATSO that “in the coming weeks and months, it will be critical that these businesses remain open, 24 hours a day, providing America’s truck drivers with fuel, food, showers, repair services and opportunities to rest.”

Truck-stop chains Pilot Flying J and TravelCenters of America, which operates TA and Petro Stopping Centers, said in online updates that their showers are open and employees are stepping up cleaning and disinfecting restrooms and commonly used areas. Both chains have posted state-by-state updates on changes in dining service.

Pilot Flying J said in its update that “we strongly encourage drivers [to] use social distancing while in our stores.”

Write to Jennifer Smith at jennifer.smith@wsj.com