diff --git a/Dockerfile b/Dockerfile index 36fd6c2..47c1eea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,9 @@ FROM ubuntu:trusty # Grab the bare necessities for installing RVM and some Rubies -RUN apt-get update && apt-get install -yq git build-essential curl gnupg -# Accept mpapis' key so we can safely install RVM -RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -# Grab the latest stable version of RVM -RUN curl -sSL https://get.rvm.io | bash -s stable +RUN apt-get update && \ + apt-get install -yq git build-essential curl gnupg && \ + gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \ + curl -sSL https://get.rvm.io | bash -s stable COPY rvmrc /root/.rvmrc diff --git a/README.adoc b/README.adoc index 2931511..235bcb9 100644 --- a/README.adoc +++ b/README.adoc @@ -3,3 +3,16 @@ This repository contains some `Dockerfile` code for building containers which come pre-baked with RVM for builds and tests in link:https://jenkins.io[Jenkins]. + + +== Tags + +The `rtyler/rvm` image alone is simply `ubuntu:trusty` with the latest stable +link:http://rvm.io[RVM] installed on it. There are however additional tags with Rubies +pre-installed: + +* `rtyler/rvm:2.3.0` - Ruby (MRI) 2.3.0 +* `rtyler/rvm:jruby` - JRuby, whichever version RVM aliases to +* `rtyler/rvm:ruby-head` - Ruby (MRI)'s latest `HEAD` at the time of image + creation +* `rtyler/rvm:rubinius` - Rubinius diff --git a/build-rubies.sh b/build-rubies.sh new file mode 100755 index 0000000..07a9876 --- /dev/null +++ b/build-rubies.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -x + +source ./rubies + +mkdir -p work + +for RUBY in "${RUBIES[@]}"; do + DOCKERFILE="work/dockerfile-${RUBY}" + cat > $DOCKERFILE < Making ${IMAGE_TAG}:${RUBY}" + docker build --tag="${IMAGE_TAG}:${RUBY}" --file="${DOCKERFILE}" work + + if [ -f "${DOCKERFILE}" ]; then + rm -f $DOCKERFILE + fi; +done; diff --git a/push-rubies.sh b/push-rubies.sh new file mode 100755 index 0000000..b88bc97 --- /dev/null +++ b/push-rubies.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -x + +source ./rubies + +for RUBY in "${RUBIES[@]}"; do + echo "> Pushing ${IMAGE_TAG}:${RUBY}" + docker push ${IMAGE_TAG}:${RUBY} +done; diff --git a/rubies b/rubies new file mode 100644 index 0000000..a6b7334 --- /dev/null +++ b/rubies @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export RUBIES=( 2.3.0 jruby rubinius ruby-head) + +export IMAGE_TAG="rtyler/rvm"