Barracks are the buildings where soldiers live. Rows of beds, a parade ground outside, and everything inspected.
The word looks plural and is treated as either singular or plural, so the barracks is on the edge of town is perfectly correct. Confined to barracks is a punishment meaning not allowed out. The adjective barrack-room describes a rough soldierly style, as in barrack-room lawyer for somebody who argues about rules. British football has a separate verb, since to barrack somebody is to jeer at them.
1nounbarracksA building or group of buildings where soldiers live.
“The regiment moved into new barracks that spring.”