The cargo vessel bound for Felixstowe returned to the Dutch port of Vlaardingen, near Rotterdam, as soon as the stowaways were found, they said in a statement.
The people found in the container received medical attention at the port and two were taken to hospital for further treatment for possible hypothermia.
The discovery comes the month after 39 Vietnamese people were found dead in a refrigerated truck in Britain, again laying bare the risks of illegal migrant routes to Europe.
“On board a ship it turned out that several people were found in a cooling container. The ship returned to the harbour,” said the Rotterdam region emergency services on Twitter.
“The 25 people were taken off the ship and given the medical care they need. Earlier the message came from the ship that no people died.
“Two people were transported to hospital for extra medical care. Twenty-three people were transferred to a police location after a medical check-up.”
DFDS Seaways, which operates the cargo ferry, said that the migrants had come on board on a lorry trailer, De Telegraaf newspaper said.
The driver of the truck had been arrested, it added.
A bus took away the mainly male group, some of whom were wrapped in silver thermal blankets.
Their nationalities were not immediately known.