We have designed and implemented an optical-trapping configuration that uses near-infrared laser diodes. The highly divergent output beam of the diode laser was collimated by using only one aspheric compact disc lens. The resulting output beams are astigmatic and elliptic and have a flat, non-Gaussian intensity profile. Calculations and measurements were performed to investigate the influence of this profile on the trapping forces. The results show that use of a laser diode, collimated with a compact disc lens, provides a near-infrared light source that can be used for optical trapping. The light source is compact and relatively cheap and can be easily incorporated into an existing microscope.