Well, it's perhaps more common to say, "This bottle can hold three gallons."
This is interesting. If the bottle is full, we probably wouldn't say "It holds three gallons." (But we could.) And if it's only half full, we wouldn't say "It contains three gallons." But we would say, It holds three gallons."