Skip to Content
Docker for Rails Developers
book

Docker for Rails Developers

by Rob Isenberg
February 2019
Intermediate to advanced
240 pages
5h 25m
English
Pragmatic Bookshelf
Content preview from Docker for Rails Developers

 Quick Recap

Wow, what an action-packed chapter! Let’s review the highlights:

  1. We saw our first, rough-and-ready Dockerfile designed to allow us to run our app with a Rails server:

     FROM ruby:2.6
     
     RUN apt-get update -yqq
     RUN apt-get install -yqq --no-install-recommends nodejs
     
     COPY . /usr/src/app/
     
     WORKDIR /usr/src/app
     RUN bundle install
  2. We built our custom image from this Dockerfile with:

     $ ​​docker​​ ​​build​​ ​​.
  3. We listed the images on our system by issuing:

     $ ​​docker​​ ​​images
  4. We started up a Rails server to run our app with:

     $ ​​docker​​ ​​run​​ ​​-p​​ ​​3000:3000​​ ​​a1df0eddba18​​ ​​\
      ​​bin/rails​​ ​​s​​ ​​-b​​ ​​0.0.0.0

And we saw it running in a browser on http://localhost:3000.

In the next chapter, we’ll ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Adam Notodikromo
Mastering Ruby Closures

Mastering Ruby Closures

Benjamin Tan Wei Hao

Publisher Resources

ISBN: 9781680506730Errata Page