Capacities of brewery casks were formerly measured and standardised according to a specific system of English units. The system was originally based on the ale gallon of 282 cubic inches. In United Kingdom and its colonies with the adoption of the imperial system in 1824, the units were redefined in terms of the slightly smaller imperial gallon. The older units continued in use in the United States.

The tun is a cask that is double the size of a butt and is equal to six barrels and has a capacity of 216 imperial gallons.

The butt of beer was equal to half a tun, two hogsheads, three barrels or 108 imperial gallons.

The beer barrel was defined as 36 imperial gallons.

From the mid 15th century until 1824 the beer firkin was defined as 9 imperial gallons.

More Info: en.wikipedia.org