Easy. I've bought 3 of the "Guardian Heavy Duty Rubber Parking Curb - 72" Long"
off Amazon. Honestly, fantastic. Gave two as gifts. I've never fastened them to the floor, but it worked for the exact reason you asked. I had a truck that barely squeezed in the garage.