The D-meson production is investigated by considering the unintegrated gluon distribution within the dipole approach in the momentum representation. We analyze the D-meson spectrum accounting for the effects of nonlinear behavior of the QCD dynamics which can be accordingly addressed in the dipole framework. The unintegrated gluon distribution is obtained by using geometric scaling property and the results are compared to the Glauber–Gribov framework. The absolute transverse momentum spectra and the nuclear modification ratios are investigated. Predictions are compared with the experimental measurements by the ALICE and LHCb Collaborations in pA collisions for different rapidity bins.