If you have a standard rack like the one shown below you can mount a light on it with just 4 parts. Here is one that dates back a couple of years that will work with a variety of lights. I screwed the fixed part of the Raypal 2266 rear light permanently to the plastic tube but with this light you can remove the light from the tube to charge it.
plastic tube or thin-wall aluminum tube (1/2" schedule 40 PVC pipe or an old aluminum tent pole)
two nuts and bolts
one corner bracket (available at my local dollar store in a package of 6)

Raypal 2266 USB rechargeable tail light

Light and tube separated

where the L bracket is mounted to the rack

Lezyne Drive clone mounted in the same way