Cans are my recommended container of choice when biking with beer. If you need more space, you can easily drink their contents, crush and stow. Cans are also a few grams lighter than bottles if you’re racing someone or something.
Bottles work well too. However, they lack the previously mentioned advantages of cans and are more likely to break during a catastrophic event.
An empty keg can be strapped to a conventional bike if outfitted with a rear rack. Although, you may find that the bike’s handling is impaired slightly.
If you’re riding with a half full beer mug, chances are you should probably be walking your bike.