What’s the law on petrol cans?
Yes, the law in France allows you to transport jerry cans of petrol or diesel and the legal maximum is too high to pose a problem. The key requirement is that the cans are homologué, ie. made for the purpose and with a mark showing they follow the UN regulations (ONU in French) for transporting dangerous substances.
Les jerricans in sizes of 5l, 10l and 20l are commonly sold. Note that you should also have two fire extinguishers in the car, according to the letter of the law.
The main regulations on this were ratified by 48 countries but, according to car hire firm Sixt, the carrying of jerry cans is not legal in Portugal, so there may be additional restrictions in some countries.
The RAC states people should not carry more than 10l in the car when entering France from another country. There are also restrictions imposed by some transport companies, eg. Brittany Ferries, which runs services between the UK and France and Spain, allows passengers to have only 5l containers on board (a small jerry can).