I wrote up a bunch of the lessons I learned while trying to get the official mastodon image running in docker. It ended up being quite long. Sorry.
I think the audience for this post is mostly the mastodon devs. Maybe they can help answer why some of this stuff is the way it is. But if you're a person who is interested in errata around docker, rails and mastodon, it's for you too!
https://polotek.net/posts/local-mastodon-in-docker/