We study entanglement generated between a charge qubit and a bosonic bath due to their joint evolution which leads to pure dephasing of the qubit. We tune the parameters of the interaction, so that the decoherence is quantitatively independent of the number of bosonic modes taken into account and investigate, how the entanglement generated depends on the size of the environment. A second parameter of interest is the mixedness of the initial state of the environment which is controlled by temperature. We show analytically that for a pure initial state of the environment, entanglement does not depend on environment size. For mixed initial states of the environment, the generated entanglement decreases with the increase of environment size. This effect is stronger for larger temperatures, when the environment is initially more mixed, but in the limit of an infinitely large environment, no entanglement is created at any finite temperature.