A search for CP violation in D+ -> phi pi+ decays is performed using data collected in 2011 by the LHCb experiment corresponding to an integrated luminosity of 1.0 fb^{-1} at a centre of mass energy of 7 TeV. The CP-violating asymmetry is measured to be (-0.04+/-0.14+/-0.14)% for candidates with K-K+ mass within 20 MeV/c^{2} of the phi meson mass. A search for a CP-violating asymmetry that varies across the phi mass region of the D+ -> K-K+pi+ Dalitz plot is also performed, and no evidence for CP violation is found. In addition, the CP asymmetry in the Ds+ -> Ks pi+ decay is measured to be (0.61+/-0.83+/-0.14)%.