Actually build and push the RVM-based images

This commit is contained in:
R. Tyler Croy 2016-08-03 12:12:40 -07:00
parent b18c5654e7
commit d27c009e8c
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
5 changed files with 55 additions and 5 deletions

View File

@ -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

View File

@ -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

23
build-rubies.sh Executable file
View File

@ -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 <<EOF
FROM rtyler/ci-rvm:latest
RUN bash -c 'source /usr/local/rvm/scripts/rvm && rvm install ${RUBY}'
EOF
echo "> Making ${IMAGE_TAG}:${RUBY}"
docker build --tag="${IMAGE_TAG}:${RUBY}" --file="${DOCKERFILE}" work
if [ -f "${DOCKERFILE}" ]; then
rm -f $DOCKERFILE
fi;
done;

10
push-rubies.sh Executable file
View File

@ -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;

5
rubies Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
export RUBIES=( 2.3.0 jruby rubinius ruby-head)
export IMAGE_TAG="rtyler/rvm"