In this paper, the formation tracking problem with obstacle avoidance is investigated for double-integrator systems. First, a baseline controller is provided to achieve the formation tracking mission. Then, a level-set-based control barrier function (LSCBF) is developed to avoid obstacles with complex shapes. Moreover, combining the baseline controller and the LSCBF together, the formation tracking controller with guaranteed safety is obtained by solving a quadratic programming problem. Finally, numerical simulations demonstrate the effectiveness of the proposed results.