Twenty others were in critical or serious condition, some believed to be suffering heatstroke or dehydration, and taken to hospital.
Police did not say where the vehicle came from, but confirmed that the driver was in custody.
They are investigating a possible people-smuggling offence.
The US immigration department is trying to establish the victims' status.
San Antonio Police Chief William McManus said in a media briefing that the bodies were discovered after a call from a Walmart employee, who had been approached by someone from the truck asking for water.