A $10 plastic container doesn't have nearly enough space for sustenance farming. Neither does a typical city home's garden. And for health reasons they're not going to let you raise animals (there are pretty funky diseases you and your neighbours can get from even just poultry, never mind pigs and cattle)
You can certainly grow various fun things in buckets - tomatos, herbs, etc. But you can't survive on it. Not with a small city garden.
And that's the point - in pre-industrial times, you had to survive off what you could grow, and you had a lot more land, which you used most of to grow your own food, and used most of your own time to grow food, and you were fucked at the first bad harvest (though you would likely have been part of a social contract where your local landowner took a portion of your crops to cover for these eventualities)
In post-industrial times, peasants found they could work in factories and earn much more than they could selling a portion of their crop. Countries stopped being 90% farmers. Normal people could specialise, not just the landed gentry who didn't wonder where their next meal was coming from.
And here we are typing to each other on websites.
It's sad if the city or your landlord won't let you have a garden. Gardens are wonderful things. You should try and grow something. But we're in a discussion context of "people don't even know how to grow their own food any more". Thank goodness for that, because if we did, we'd be spending all day tending to our crops, living in abject poverty, at constant risk of starvation, and we'd have no time for computers. Thank goodness for modern agricultural practise.