One of the basic characteristics of linear dsDNA molecules is its persistence length, typically of order 50 nanometers. The DNA chain inflicts a large energy penalty if it is bent sharply at that length scale. Viruses of bacteria, known as bacteriophage, typically have a dimension of a few tens of nanometers, of similar order of the magnitude as the DNA persistence length. Yet, it is known that a bacteriophage actively packages viral DNA inside the capsid and ejects it afterwards. The packaging process works under some extreme physical conditions: reduction of the DNA overall conformational entropy, competition between the persistence length and the capsid's size, and the relatively crowded density inside a packaged capsid to accommodate a long DNA chain. Here, adopting a commonly used polymer model known as the wormlike chain, we answer an idealized question: placing a linear DNA molecule inside a spherical cavity, what ordered states can we drive from known tools in statistical physics? Solving the model in a rigorous field-theory framework, we report a universal phase diagram for four orientationally ordered and disordered states, in terms of two relevant physical parameters.