It takes approximately 255 liters of water to make 250ml of milk. So 1020 liters per liter of milk. There's 3.78542 liters per gallon. So that makes about 1930 liters per half gallon milk.
510 gallons of water for 0.5 gallons of milk.
It takes between 2500 and 5000 joules of energy per liter of tap water depending on the water source (2000 times that for bottled water). So up to 9,650,000 joules of energy per half gallon of milk for the water(about 2680 Wh).
1.25 to 1.44 kg of feed to produce a liter of milk (0.2645 gallons). To produce 1kg of wheat requires between 500 and 4,000 liters of water. But then you need to transport the feed to where the cows are...
Then you have to transport the milk. How far is it, and what sort of fuel is used? What sort of bottle is used? If it's come across the country via truck in a plastic bottle, that doesn't get recycled, that could be a lot of fuel. How long was the milk refrigerated before it reaches a home fridge?
There's 4 million joules to make a PET 1 liter plastic bottle. So about 7.5 million joules for a half gallon one(2 kilo watt hours). Often the transportation uses more than that for the bottle, but varies greatly. One amount mentioned is 4 million joules per liter.
That's 4 kilo watt hours just for the bottle.
There's lots more to it, but I guess 1-2 days of solar power production from a 5kW solar system for a half gallon of milk.