https://www.codrut.pro/snippets/docker-images-basic-ruby-set...
It's a bit out of date since I need to make sure the uid/gid is a minimum of 1000 due to macos using 501:20 instead of the normal 1000:1000. And there's a compatibility package for M1 that needs yo be installed. I'll probably update the snippet in the coming days.