diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..67a57d839dcdf77da42063fd81722329b7fabe78 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,58 @@ +######################## Base Args ######################## +ARG BASE_REGISTRY=nexus-docker-secure.levelup-dev.io +ARG BASE_IMAGE=redhat/ubi/ubi8 +ARG BASE_TAG=8.2 + +ARG UBI_BASE_IMAGE=${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} + +FROM ${UBI_BASE_IMAGE} as builder + +LABEL name="Ruby" \ + description="Ruby container based off UBI8" \ + vendor="OpenSource" \ + summary="Ruby (Red Hat UBI)" \ + maintainer="OpenSource" \ + version="2.7" + +USER 0 + +COPY ruby-27.tar.gz gdbm.tar.gz scripts/*.sh / + +ARG PACKAGES="gcc-c++ patch readline zlib zlib-devel libffi-devel libedit \ + openssl-devel make bzip2 autoconf automake libtool sqlite-devel" + +RUN dnf install -y --setopt=tsflags=nodocs $PACKAGES \ + && chmod +x /install-ruby.sh /install-gdbm.sh \ + && /install-gdbm.sh \ + && /install-ruby.sh \ + && rm -f /install-ruby.sh /install-gdbm.sh \ + && rm -rf /var/cache/dnf/ /var/tmp/* /tmp/* /var/tmp/.???* /tmp/.???* + +FROM ${UBI_BASE_IMAGE} + +RUN dnf update -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf/ /var/tmp/* /tmp/* /var/tmp/.???* /tmp/.???* + +COPY --from=builder /usr/local/bin/ /usr/local/bin/ +COPY --from=builder /usr/local/lib/ /usr/local/lib/ +COPY --from=builder /usr/local/include/ /usr/local/include/ + +ENV RUBY_MAJOR=2 \ + RUBY_MINOR=7 + +ENV HOME=/opt/app-root/src +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $HOME/bin:$GEM_HOME/bin:$PATH + +RUN mkdir -p "$GEM_HOME" && chmod 700 "$GEM_HOME" + +RUN useradd -u 1001 -g 0 -M -d /opt/app-root/src default && \ + mkdir -p /opt/app-root/src && \ + chown -R 1001:0 /opt/app-root + +USER 1001 + +CMD ["irb"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..7b3f2f39adbc1fc53e9bb73f96582d6e12d24c12 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,2 @@ +@Library('DCCSCR@master') _ +dccscrPipeline(version: "2.7.1") diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..426810a7fbbac50ea6e8da6a3cc7bdaa7d1d5c93 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,56 @@ +Ruby is copyrighted free software by Yukihiro Matsumoto . +You can redistribute it and/or modify it under either the terms of the +2-clause BSDL (see the file BSDL), or the conditions below: + + 1. You may make and give away verbatim copies of the source form of the + software without restriction, provided that you duplicate all of the + original copyright notices and associated disclaimers. + + 2. You may modify your copy of the software in any way, provided that + you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise + make them Freely Available, such as by posting said + modifications to Usenet or an equivalent medium, or by allowing + the author to include your modifications in the software. + + b) use the modified software only within your corporation or + organization. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 3. You may distribute the software in object code or binary form, + provided that you do at least ONE of the following: + + a) distribute the binaries and library files of the software, + together with instructions (in the manual page or equivalent) + on where to get the original distribution. + + b) accompany the distribution with the machine-readable source of + the software. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 4. You may modify and include the part of the software into any other + software (possibly commercial). But some files in the distribution + are not written by the author, so that they are not under these terms. + + For the list of those files and their copying conditions, see the + file LEGAL. + + 5. The scripts and library files supplied as input to or produced as + output from the software do not automatically fall under the + copyright of the software, but belong to whomever generated them, + and may be sold commercially, and may be aggregated with this + software. + + 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. diff --git a/README.md b/README.md index d3f676558399e7fe44aed79a04bb2f0a84fc4965..9bcb4a6ae87672edc85969aa38dced32ff151978 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ -# ruby27 +# Overview +Ruby 2.7 was released on 12-25-2019 and has no end of life yet. + +# Environment Variables + +Name | Description | Default Value +--- | --- | --- +RUBY_MAJOR | The major version of Ruby. | 2 +RUBY_MINOR | The minor version of Ruby. | 7 +HOME | The path to the home folder for the default user (UID 1001). | /opt/app-root/src +GEM_HOME | The default path to GEM files. | /usr/local/bundle +BUNDLE_SILENCE_ROOT_WARNING | Silence the warning Bundler prints when installing gems as root. | 1 +BUNDLE_APP_CONFIG | Location of the Gem bundle to install. | Value of $GEM_HOME + +# Documentation + +Documentation for this version of Ruby can be found [here](https://docs.ruby-lang.org/en/2.7.0/). + +# Basis + +This applicaiton is based on the following: +- https://hub.docker.com/_/ruby +- https://github.com/docker-library/ruby \ No newline at end of file diff --git a/download.yaml b/download.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3d731e0c00b45487af48125c69e455f035fbf47d --- /dev/null +++ b/download.yaml @@ -0,0 +1,12 @@ +--- +resources: + - url: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.gz + filename: ruby-27.tar.gz + validation: + type: sha256 + value: d418483bdd0000576c1370571121a6eb24582116db0b7bb2005e90e250eae418 + - url: http://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz + filename: gdbm.tar.gz + validation: + type: sha256 + value: 86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc \ No newline at end of file diff --git a/scripts/install-gdbm.sh b/scripts/install-gdbm.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a44b1e6e382ec3202f1b4209abf6807775e4387 --- /dev/null +++ b/scripts/install-gdbm.sh @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +mkdir -p /usr/src +tar -xzf gdbm.tar.gz -C /usr/src/ +rm -f gdbm.tar.gz + +GDBM_DIR=$(ls /usr/src/ | grep gdbm) + +cd /usr/src/${GDBM_DIR} +./configure + +make -j "$(nproc)" +make install + +rm -rf /usr/src/${GDBM_DIR} diff --git a/scripts/install-ruby.sh b/scripts/install-ruby.sh new file mode 100644 index 0000000000000000000000000000000000000000..7158e8511d1b1843c1b63962f98d82f3df2d28a0 --- /dev/null +++ b/scripts/install-ruby.sh @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +mkdir -p /usr/src +tar -xzf ruby-27.tar.gz -C /usr/src/ +rm -f ruby-27.tar.gz + +RUBY_DIR=$(ls /usr/src/ | grep ruby) + +cd /usr/src/${RUBY_DIR} +./configure --disable-install-doc --enable-shared + +make -j "$(nproc)" +make install + +rm -rf /usr/src/${RUBY_DIR}