The emergence of a Bose-glass region in a quasi one-dimensional Bose-Einstein-condensed gas in a harmonic trapping potential with an additional delta-correlated disorder potential at zero temperature is studied using three approaches. At first, the corresponding time-independent GrossPitaevskii equation is numerically solved for the condensate wave function, and disorder ensemble averages are evaluated. In particular, we analyse quantitatively the emergence of mini-condensates in the local minima of the random potential, which occurs for weak disorder preferentially at the border of the condensate, while for intermediate disorder strength this happens in the trap centre. Second, in view of a more detailed physical understanding of this phenomenon, we extend a quite recent nonperturbative approach towards the weakly interacting dirty boson problem, which relies on the Hartree-Fock theory and is worked out on the basis of the replica method, from the homogeneous case to a harmonic confinement. Finally, in the weak disorder regime we also apply the ThomasFermi approximation, while in the intermediate disorder regime we additionally use a variational ansatz in order to describe analytically the numerically observed redistribution of the fragmented mini-condensates with increasing disorder strength.