The compression factor only works if the air is compressed QUICKLY. A diesel engine works by compressing the air inside the cylinder to over 400 psi, again very quickly, causing the air become very hot. At just the right moment, the diesel fuel is spray-injected in, at very high pressure. When the "spray" hits the superheated air, it ignites. Gasoline in a diesel engine ignites way too fast, causing preignition, and lots of smoke lol.
If you simply used a normal compressor to compress the air inside a gasoline-filled container, it would never heat up enough to ignite the gas..unless you could pressurize the container in a fraction of a second.. this is of course if you have a container capable of holding the pressure such as that inside a diesel engine cylinder.
OT EDIT:.. If you really want to have some fun(sarcasm intended), try adjusting an RPM governor on an older detroit deisel engine.. If you let the lever go at the wrong time without being secured(it's a three-hand job to adjust one), the engine will "run away" and rev up to over 13,000 RPM before disintegrating into a million bits.... It's quite a sight to see.. one of my more interesting memories from my Army days LOL.