Skip to content

Instantly share code, notes, and snippets.

Created Jun 27, 2013
What would you like to do?
My very first Dockerfile! It installs Ruby 2.0 from scratch, installs bundler, and then vendors in my app and installs dependencies.
# Use Ubuntu 12.04 as the base image
FROM ubuntu:precise
# Install a bunch of prerequisites
RUN apt-get update
RUN apt-get install -y git-core curl wget libssl1.0.0 python-yaml build-essential libssl-dev
# Install ruby-build
RUN git clone
RUN cd ruby-build && ./
RUN mkdir -p /opt/rubies
# Install Ruby 2.0.0-p0
RUN /usr/local/bin/ruby-build 2.0.0-p0 /opt/rubies/2.0.0-p0
ENV PATH /app/bin:/app/vendor/bundle/bin:/opt/rubies/2.0.0-p0/bin:/usr/local/bin:/usr/bin:/bin
RUN gem install bundler
# Vendor in the app, in this case the directory where the Dockerfile is
ADD . /app
# Install app dependencies with bundler
RUN cd /app && bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin

This comment has been minimized.

Copy link

@wyaeld wyaeld commented Sep 28, 2013

Hi @peterkeen

Like the way you have this set up, later versions of Docker appear to be more strict on ordering, and require the FROM to come before the MAINTAINER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment