Generating a New Rails App Without Ruby Installed

Running a Ruby script was cool, but what else can we do?

Wouldn’t it be nice to start using Docker for some “real-world” tasks? Let’s imagine we want to create a new Rails project (that’s not so far-fetched…we are Ruby developers after all). Can we do that? You bet.

We’re going to want to run multiple commands in succession in a container in order to generate the Rails project. We could craft a really long, ugly docker run that executes the instructions one after another. However, that’s going to be hard to comprehend.

Instead, we can do something a little different. We can start a container running an interactive Bash shell. When we do this, we literally get a terminal session running inside ...

Get Docker for Rails Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.