  Let X be a smooth projective Berkovich space over a complete discrete
valuation field K of residue characteristic zero, and assume that X is defined
over a function field admitting K as a completion. Let further m be a positive
measure on X and L be an ample line bundle such that the mass of m is equal to
the degree of L. Then we show the existence a continuous semipositive metric
whose associated measure is equal to m in the sense of Zhang and Chambert-Loir.
This we do under a technical assumption on the support of m, which is, for
instance, fulfilled if the support is a finite set of divisorial points. Our
method draws on analogues of the variational approach developed to solve
complex Monge-Amp\`ere equations on compact K\"ahler manifolds by Berman,
Guedj, Zeriahi and the first named author, and of Ko{\l}odziej's continuity
estimates. It relies in a crucial way on the compactness properties of singular
semipositive metrics, as defined and studied in a companion article.
