The Euler-Heisenberg black holes with quantum electrodynamics (QED) correction are embraced by a cavity in this paper, which serves as a boundary of the black hole spacetime and contributes to the equilibrium of the system. We explore the thermodynamic properties of the black hole, including the phase transitions and phase structures. The small/large black hole phase transition occurs for a negative QED parameter, while the reentrant phase transition can be observed for a small positive QED parameter. Then the thermodynamic geometry is investigated to diagnose microscopic interactions of black hole thermodynamic systems. For the reentrant phase transition, the small black holes are dominated by repulsion for the first-order coexistence curve, while the interaction between the small black hole molecules could be attractive or repulsive for the small/large black hole phase transition.