The phrase you’re my rock means a person supports another person the same way a rock supports. Thus, such phrases describe strong support like a rock can provide. Comparing a person and his support to a rock means referring to the hardness and strength of the rock.