A city of the first class may provide for the erection of all necessary pens, pounds, and buildings for the use of the city, within the city limits or within its extraterritorial zoning jurisdiction, appoint and compensate keepers thereof, and establish and enforce rules governing the same.