Docker Community Forums

Share and learn in the Docker community.

Does the ruby image contain rails?


(Lorchong) #1

The Rails image is deprecated in favor of the standard Ruby image. Does this mean the Ruby image also contains Rails? I want to develop web sites locally based on Ruby on Rails using MariaDB database if possible.

Thanks!


(Bryce Ryan) #2

It appears the rails repo provides some guidance on adding rails support to your own image when using the ruby image as a base layer. See the repo description in the rails repo, which says

For example, a Dockerfile similar to the following would be a good starting point for a Rails project using PostgreSQL:

FROM ruby:2.3

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        postgresql-client \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
COPY Gemfile* ./
RUN bundle install
COPY . .

EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]