Conventional plastic-bag-lined garbage containers were rare. These compactor models were ubiquitous. There are solar panels on the roof of the can to power it.
It was necessary to pull the door open quite a way before placing the garbage in the compartment and closing the door. It was not possible to insert a hand or arm into the container.
Periodically, the compactor compresses all the garbage into a smaller pile, so the can needs not be emptied so often. Nothing blows around either. Here is a row of three containers, for bottles/cans, trash, and paper.
The top two pictures were of models used in Cambridge MA and the bottom one is of the WMI containers used throughout Boston itself. The end panel has an advertising sleeve with a Boston U advert.