The interaction force between likely charged particles/surfaces is usually repulsive due to the Coulomb interaction. However, the counterintuitive like-charge attraction in electrolytes has been frequently observed in experiments, which has been theoretically debated for a long time. It is widely known that the mean field Poisson-Boltzmann theory cannot explain and predict this anomalous feature since it ignores many-body properties. In this paper, we develop efficient algorithm and perform the force calculation between two interfaces using a set of self-consistent equations which properly takes into account the electrostatic correlation and the dielectric-boundary effects. By solving the equations and calculating the pressure with the Debye-charging process, we show that the self-consistent equations could be used to study the attraction between like-charge surfaces from weak-coupling to mediate-coupling regimes, and that the attraction is due to the electrostatics-driven entropic force which is significantly enhanced by the dielectric depletion of mobile ions. A systematic investigation shows that the interaction forces can be tuned by material permittivity, ionic size and valence, and salt concentration, and that the like-charge attraction exists only for specific regime of these parameters.