We consider static, spherically symmetric configurations in general relativity, supported by nonlinear electromagnetic fields with gauge-invariant Lagrangians depending on the single invariant f = FμνFμν. After a brief review on black hole (BH) and solitonic solutions, obtained so far with pure electric or magnetic fields, an attempt is made to obtain dyonic solutions, those with both electric and magnetic charges. A general scheme is suggested, leading to solutions in quadratures for an arbitrary Lagrangian function L(f) (up to some monotonicity restrictions); such solutions are expressed in terms of f as a new radial coordinate instead of the usual coordinate r. For the truncated Born-Infeld theory (depending on the invariant f only), a general dyonic solution is obtained in terms of r. A feature of interest in this solution is the existence of a special case with a self-dual electromagnetic field, f ≡ 0 and the Reissner-Nordström metric. © 2017, Pleiades Publishing, Ltd.