2 months ago I got "Docker for Rails Developer" book. It's easy to follow step by step for beginner.
However I haven't try it for production purpose, because my projects are not ready yet to use Docker for production. There will many changes on assets, database, and caching system. So I use it for development environment only till now.
After few days learning this Docker thing, I found great gem to build Dockerfile and docker-compose.yml files rails. The gem is dockrails, it uses unison to sync your files.
If I could give a recommendation for you, I would recommend you to read "Docker for Rails Developer" book first, try to use it on new rails app, then use dockrails, so it will be easy when you struggle when setting up the env.
Following is my cheatsheet, maybe it would useful for you :)
docker images
docker ps -a
docker run ruby:2.6 ruby -e "puts :hello"
docker run --rm ruby:2.6 ruby -e "puts :hello"
docker run -i -t --rm -v ${PWD}:/usr/src/app ruby:2.6 bash
docker run -p 3000:3000 image_id bin/rails s -b 0.0.0.0
docker ps -a
docker build .
docker rm container_id1 container_id2
docker system prune --volumes
docker container prune
docker image prune -a
For me, when I send SIGINT (Ctrl+C) command, usually the database data is not saved in Docker's volume, so database data is lost.To prevent that I use "docker-compose down" command