-
-
Save darkhelmet/9340396 to your computer and use it in GitHub Desktop.
Using docker to build deb of ruby so you don't need to use rvm or something on the server
This file contains hidden or 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
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