Created
June 27, 2013 05:43
-
-
Save peterkeen/5874224 to your computer and use it in GitHub Desktop.
My very first Dockerfile! It installs Ruby 2.0 from scratch, installs bundler, and then vendors in my app and installs dependencies.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAINTAINER Pete Keen "pete@petekeen.com" | |
# 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 https://github.com/sstephenson/ruby-build.git | |
RUN cd ruby-build && ./install.sh | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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