Ruby on Whales: Dockerizing Ruby and Rails development

This post introduces a Docker configuration used for developing my Ruby on Rails projects. This configuration came out of—and then further evolved—during development at Evil Martians. It's an exhaustive and documented guide, so, I hope you enjoy it! **As mentioned in the article, feedback is welcome!**


6 thoughts on “Ruby on Whales: Dockerizing Ruby and Rails development”

  1. This has long been my go to recommendation for Rails/Docker guides. The details about volumes is great. Note for a fresh rails app, that is looking to avoid Webpack, Yarn, and Node, the config can be simplified a bit.

  2. >I used to develop using Vagrant, but its VMs were a bit too heavy for my 4GB RAM laptop. In 2017

    Switching a Rails app in development to docker from a VM results in less ram usage? How does that work?

  3. Question – you have these lines a few times in the Dockerfile, and I’m wondering what the value is:

    some apt-get install commands \
    && apt-get clean \
    && rm -rf /var/cache/apt/archives/* \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
    && truncate -s 0 /var/log/*log

    My 2 guesses are that 1) it removes package info so a future apt-get install command doesn’t install an unintended new version, or 2) it shrinks the container size.


Leave a Comment