Why ice freeze into triangular shapes?

if you fill up a container then put it in the freezer then it will freeze however the water is. so if you fill up a triangle container then freeze it then it will be a frozen triangle