Painless Ruby on Rails Dev Environment setup with Docker

Painless Ruby on Rails Dev Environment setup with Docker

You've heard about the docker terms like containers, images, services, volumes, network, Dockerfile, docker-compose file, or watched some videos about what it is, but not sure how can it apply to your daily life as a developer? That's what I first thought off after watching videos about docker. Not only can docker can run web-apps, servers, databases, it can also be a local development environment! I wrote this article so not only you can learn how to do it, but also for me, so I won't forget it. Let's get started!

This is a companion discussion topic for the original entry at

Thanks Jonathan for this article.
My experience with docker / rails-dev is:

In a team …great, Docker is a good choice to have same dev conditions for all.
Alone, I don’t see the point. On my Mac, Docker consumes enormous amount of RAM. You need at least 16GB to work with…(had to buy a new MBP…)

I wonder why installing RVM was no fun for you? It is easy to set up, at the most 30 min all inclusive…
Gemfile/Gemfile.lock and installing same Ruby versions as before should take care that the app will run again after reorganization.
Greetings from Munich…

Thanks for sharing your thoughts Werner.
Works good on my 8GB MPB with 128gb of storage.

I have some dockerized apps, and I’m testing it on local machine. So what I’ve thought of, instead of installing both docker and rails on my machine (which will take much of my space), I’ll use both docker and rails for my dev.

Plus linking databases on your server makes it easy with docker. I got a problem making my Wordpress LAMP stack work on my mac, and docker made the setup easy.

And when I need more storage I just prune my containers and images. Easy cleanup of dev environment is a win for me.

Hope it helps


Thanks for this article. It is something I’d like to do but I’m running rails in Win 10 WSL (Windows Subsystem for Linux). I’m new with Docker. I have it installed but I can’t figure out where or how I make the container. My Ruby/Rails installation is in WSL/Ubuntu. I’m thinking that is where I need to install Docker and then create the container.

Any idea? I see you’re on MAC, but I’m hoping someone has some thoughts.

Thanks in advance, Ray

Hi Jonathan,

Thank you for great tutorial, I was facing some issue when I tried to run rails s because the installed rails version is version 6.