Another 90 migrants recovered from the container on Monday were in critical condition and taken to a local hospital for treatment, the security directorate in the town of Zuwarah said in a statement.
Zuwarah is one of the points along Libya's western coastline where smugglers and traffickers hold migrants before putting them on boats to try to cross to Europe.
The migrants were from various sub-Saharan African and Arab countries, as well as Pakistan and Bangladesh, the statement said.
They had been locked inside a refrigerated container designed for transporting meat and fish that was found just outside Zuwarah, close to the Mellitah oil and gas complex, about 110km from the capital, Tripoli.
"As a result of the length of time they suffocated, eight of them died including six children, one woman and a young man," the security directorate said.
It posted pictures of at least nine plastic jerry cans holding petrol, as well as a pile of life-jackets apparently intended for use in a boat crossing.
Daytime temperatures in northwest Libya have been in the mid to high 30 degrees Celsius in recent days.
It's the latest migrant tragedy in Libya, where human trafficking and lawlessness has thrived since the 2011 uprising that toppled and killed Libyan leader Muammar Gaddafi.
Rival governments based in eastern and western Libya rely on militias to maintain order. However, some armed groups have become involved in human trafficking.
Libya continues to be the main point of departure for asylum seekers attempting to cross the Mediterranean Sea to seek refuge in Europe.
Smugglers and traffickers took advantage of Libya's lawlessness to send hundreds of thousands of migrants to Italy over the past four years, though flows have slowed since last summer because of an Italian-backed crackdown on smuggling networks.
Last month, UN High Commissioner for Refugees (UNHCR) spokesman Charlie Yaxley noted for the fifth year in a row the "grim milestone" of 1,000 migrant deaths in the Mediterranean had been crossed.
According to a 2018 report by Human Rights Watch, boats full of migrants and asylum seekers attempting to cross the sea have been taken back to Libya after being intercepted by the Libyan coast guard, which is trained by the EU and Italy. Upon their return, many were beaten and sexually abused and faced abduction, extortion, harsh detention conditions, and forced labour.
More than 400,000 migrants in Libya are exposed to abuse and human rights violations "as rent-seeking armed groups proliferate and engage in smuggling, trafficking and exploitation of this group", the International Organisation for Migration noted in a report.