-
-
Save jwieringa/46ae780a65f1c700141e to your computer and use it in GitHub Desktop.
Minimal Dockerfile for Alpine Linux with configurable ruby helper script
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
FROM alpine:3.3 | |
MAINTAINER Christopher Sexton <[email protected]> | |
ENV RUBY_VERSION 2.3.0 | |
ENV RUBY_DOWNLOAD_SHA1 96e620e38af351c8da63e40cfe217ec79f912ba1 | |
ENV BASE_PACKAGES bash curl gmp git | |
ENV BUILD_PACKAGES build-base libc-dev linux-headers openssl-dev postgresql-dev libxml2-dev libxslt-dev | |
RUN apk update && \ | |
apk upgrade && \ | |
apk add $BASE_PACKAGES && \ | |
rm -rf "/var/cache/apk/*" | |
COPY ./script/install-ruby /usr/local/bin/install-ruby | |
RUN apk --update add --virtual build_deps $BUILD_PACKAGES && \ | |
install-ruby $RUBY_VERSION | |
apk del build_deps && \ | |
rm -rf "/var/cache/apk/*" | |
RUN gem install bundler --no-rdoc --no-ri | |
RUN mkdir /app | |
WORKDIR /app | |
COPY Gemfile /app/ | |
COPY Gemfile.lock /app/ | |
RUN bundle install | |
COPY . /app |
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
#!/bin/sh | |
RUBY_VERSION=$1 | |
set -e | |
cd /tmp | |
wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION%.*}/ruby-$RUBY_VERSION.tar.xz" | |
#echo "$RUBY_DOWNLOAD_SHA1 ruby.tar.xz" | sha1sum -c - | |
tar -xJf ruby.tar.xz | |
rm ruby.tar.xz | |
cd "/tmp/ruby-$RUBY_VERSION" | |
./configure --disable-install-doc | |
make | |
make install | |
rm -rf "/tmp/ruby-$RUBY_VERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment