Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stop using rbenv & rvm on servers. plz. kthnx.
cat > Dockerfile <<\EOF
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y ruby1.9.3 build-essential \
libc6-dev libffi-dev libgdbm-dev libncurses5-dev \
libreadline-dev libssl-dev libyaml-dev zlib1g-dev
RUN gem install fpm --bindir=/usr/bin --no-rdoc --no-ri
RUN apt-get install -y curl
RUN curl ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz|tar oxzC /tmp
WORKDIR /tmp/ruby-1.9.3-p484
RUN ./configure --disable-install-doc --prefix=/usr
RUN make install DESTDIR=/tmp/fpm
WORKDIR /
RUN fpm \
-s dir \
-t deb \
-n ruby \
-v 1.9.3-p484-1 \
-d libc6-dev \
-d libffi-dev \
-d libgdbm-dev \
-d libncurses5-dev \
-d libreadline-dev \
-d libssl-dev \
-d libyaml-dev \
-d zlib1g-dev \
-C /tmp/fpm \
-p /ruby-1.9.3-p484.deb \
usr
EOF
docker build -t ruby .
docker run -i -t -v `pwd`:/tmp ruby cp /ruby-1.9.3-p484.deb /tmp/
ls -la ./ruby-1.9.3-p484.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.