diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml new file mode 100644 index 0000000..000ab3f --- /dev/null +++ b/.github/workflows/build-ruby.yml @@ -0,0 +1,119 @@ +name: Build Ruby + +on: + workflow_dispatch: + inputs: + push: + description: Push images + required: true + type: boolean + default: true + push: + branches: + - "**" + +env: + REGISTRY: ghcr.io + REPO: datadog/images-rb + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - engine: ruby + version: "2.1" + - engine: ruby + version: "2.2" + - engine: ruby + version: "2.3" + - engine: ruby + version: "2.4" + - engine: ruby + version: "2.5" + - engine: ruby + version: "2.6" + - engine: ruby + version: "2.7" + - engine: ruby + version: "3.0" + - engine: ruby + version: "3.1" + - engine: ruby + version: "3.2" + - engine: ruby + version: "3.3" + - engine: ruby + version: "3.4" + - engine: jruby + version: "9.2" + - engine: jruby + version: "9.3" + - engine: jruby + version: "9.4" + runs-on: ubuntu-latest + name: Build (${{ matrix.engine }} ${{ matrix.version }}) + steps: + - name: Set variables + id: vars + run: | + echo "SRC=engines/${{ matrix.engine }}/${{ matrix.version }}" >> $GITHUB_OUTPUT + echo "IMAGE=${{ env.REGISTRY }}/${{ env.REPO }}/engines/${{ matrix.engine }}" >> $GITHUB_OUTPUT + echo "TAG=${{ matrix.version }}" >> $GITHUB_OUTPUT + echo "DOCKERFILE=engines/${{ matrix.engine }}/${{ matrix.version }}/Dockerfile" >> $GITHUB_OUTPUT + - name: Checkout + uses: actions/checkout@v4 + + # Using docker-container engine enables advanced buildx features + - name: Set up Docker container engine + run: | + docker buildx create --name=container --driver=docker-container --use --bootstrap + + # First, build image for x86_64 as it will fail fast + # + # Tagging is necessary to reference the image for the testing step + # Tagging is done separately to avoid interfrence with caching + - name: Build single-arch image (x86_64) + run: | + docker buildx build ${{ steps.vars.outputs.SRC }} --builder=container --cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} --output=type=image,push=false --platform linux/x86_64 -f ${{ steps.vars.outputs.DOCKERFILE }} + - name: Tag single-arch image (x86_64) + run: | + docker buildx build ${{ steps.vars.outputs.SRC }} --builder=container --cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} --load --platform linux/x86_64 -f ${{ steps.vars.outputs.DOCKERFILE }} --tag ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} + - name: Test single-arch image (x86_64) + run: | + docker run --platform linux/x86_64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} ruby -e 'puts RUBY_DESCRIPTION' + docker run --platform linux/x86_64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} gem --version + docker run --platform linux/x86_64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} bundle --version + + # Then, build image for aarch64 which, being emulated under qemu, is slower + # + # Tagging is necessary to reference the image for the testing step + # Tagging is done separately to avoid interfrence with caching + # Start by enabling qemu for aarch64 + - name: Enable aarch64 emulation (x86_64) + run: | + docker run --privileged --rm tonistiigi/binfmt --install arm64 + - name: Build single-arch image (aarch64) + run: | + docker buildx build ${{ steps.vars.outputs.SRC }} --builder=container --cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} --output=type=image,push=false --platform linux/aarch64 -f ${{ steps.vars.outputs.DOCKERFILE }} + - name: Tag single-arch image (aarch64) + run: | + docker buildx build ${{ steps.vars.outputs.SRC }} --builder=container --cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} --load --platform linux/aarch64 -f ${{ steps.vars.outputs.DOCKERFILE }} --tag ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} + - name: Test single-arch image (aarch64) + run: | + docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} ruby -e 'puts RUBY_DESCRIPTION' + docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} gem --version + docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} bundle --version + + # Finally, assemble multi-arch image for a combined push to the registry + # + # This reruns docker build but layers are in the cache, so it's fast + - name: Log in to the Container Registry + if: ${{ inputs.push }} + run: | + echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin + - name: Build multi-arch image (x86_64, aarch64) + if: ${{ inputs.push }} + run: | + docker buildx build ${{ steps.vars.outputs.SRC }} --builder=container --cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} --output=type=image,push=true --build-arg BUILDKIT_INLINE_CACHE=1 --platform linux/x86_64,linux/aarch64 -f ${{ steps.vars.outputs.DOCKERFILE }} --tag ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37b52cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.envrc diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5f8fd63 --- /dev/null +++ b/LICENSE @@ -0,0 +1,6 @@ +## License + +This work is dual-licensed under Apache 2.0 or BSD3. +You may select, at your option, one of the above-listed licenses. + +`SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause` diff --git a/LICENSE.Apache b/LICENSE.Apache new file mode 100644 index 0000000..929dd73 --- /dev/null +++ b/LICENSE.Apache @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2024, Datadog + All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE.BSD3 b/LICENSE.BSD3 new file mode 100644 index 0000000..c5981dd --- /dev/null +++ b/LICENSE.BSD3 @@ -0,0 +1,24 @@ +Copyright (c) 2024, Datadog +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of copyright holders nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..126faa6 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Container images for Ruby + +Instead of cherry-picking images across a variety of sources and bespoke-building images from these sources and yet others, this repository and corresponding packages serves as a central place to look for, provide, define, reuse, manage, an d build a set of images. + +The build process is envisioned as being efficient at layering for fast building, cacheability, and (a form of) reproducibility and auditability. + +All images should support `aarch64` and `x86_64`. When possible and relevant, there should be `glibc`- and `musl`-based variants. + +Use cases include: + +- having a consistent set of images to build other images from +- providing base images for CI usage and testing as well as local development +- providing minimal app images using various frameworks for CI testing (integration, system tests), issue reproduction, support engineers, pentesters... +- making CI runtime environment reproducinble locally +- hastening image building and fetching by mutualising commonality +- customising in subsequent layers for bespoke usage + +## Images + +### Ruby engines + +Supported engines include: + +- `ruby`: MRI a.k.a CRuby. +- `jruby`: These are based on Eclise Temurin JDK builds. +- `truffleruby`: Due to the nature and state of TruffleRuby these are experimental and may or may not work as expected. + +### Apps + +#### minimal-rack + +These images provide a set of minimal rack-based applications covering a range of frameworks and versions: + +- `rack` 1.3 to 3 and up +- `rails` 3.2 to 7 and up +- `sinatra` 1.0 to 4 and up +- `grape` 1.2 to 4 and up diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..02307aa --- /dev/null +++ b/shell.nix @@ -0,0 +1,22 @@ +{ + pkgs ? import {}, + pinned ? import(fetchTarball("https://github.com/NixOS/nixpkgs/archive/47b604b07d1e.tar.gz")) {}, +}: +let + ruby = pinned.ruby_3_3; + llvm = pinned.llvmPackages_16; +in llvm.stdenv.mkDerivation { + name = "shell"; + + buildInputs = [ + ruby + pinned.libyaml.dev + ]; + + shellHook = '' + export RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION.gsub(/\d+$/, "0")')" + export GEM_HOME="$(pwd)/vendor/bundle/ruby/$RUBY_VERSION" + export BUNDLE_PATH="$(pwd)/vendor/bundle" + export PATH="$GEM_HOME/bin:$PATH" + ''; +} diff --git a/src/engines/jruby/9.2/Dockerfile b/src/engines/jruby/9.2/Dockerfile new file mode 100644 index 0000000..e539d6c --- /dev/null +++ b/src/engines/jruby/9.2/Dockerfile @@ -0,0 +1,108 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM eclipse-temurin:8-jammy AS jruby-9.2.21.0-jre8 + +RUN apt-get update && apt-get install -y libc6-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV JRUBY_VERSION 9.2.21.0 +ENV JRUBY_SHA256 dbf05fca4f61bd7d5131d9b83c5f4d1a249213c474b82def37e82013969c8b8a +RUN mkdir /opt/jruby \ + && curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \ + && echo "$JRUBY_SHA256 /tmp/jruby.tar.gz" | sha256sum -c - \ + && tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \ + && rm /tmp/jruby.tar.gz \ + && update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 +ENV PATH /opt/jruby/bin:$PATH + +# skip installing gem documentation +RUN mkdir -p /opt/jruby/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /opt/jruby/etc/gemrc + +RUN gem install rake net-telnet xmlrpc + +# install things globally, for great justice +# and don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_BIN="$GEM_HOME/bin" \ + BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $BUNDLE_BIN:$PATH +RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ + && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" + +CMD [ "irb" ] + +FROM jruby-9.2.21.0-jre8 + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq \ + build-essential \ + shared-mime-info; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Ensure JRuby is available when running "bash --login" +RUN echo "export PATH=/opt/jruby/bin:$BUNDLE_BIN:\$PATH" >> ~/.profile + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/jruby/9.3/Dockerfile b/src/engines/jruby/9.3/Dockerfile new file mode 100644 index 0000000..d598823 --- /dev/null +++ b/src/engines/jruby/9.3/Dockerfile @@ -0,0 +1,108 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM eclipse-temurin:11-jammy AS jruby-9.3.9.0-jre11 + +RUN apt-get update && apt-get install -y libc6-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV JRUBY_VERSION 9.3.9.0 +ENV JRUBY_SHA256 251e6dd8d1d2f82922c8c778d7857e1bef82fe5ca2cf77bc09356421d0b05ab8 +RUN mkdir /opt/jruby \ + && curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \ + && echo "$JRUBY_SHA256 /tmp/jruby.tar.gz" | sha256sum -c - \ + && tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \ + && rm /tmp/jruby.tar.gz \ + && update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 +ENV PATH /opt/jruby/bin:$PATH + +# skip installing gem documentation +RUN mkdir -p /opt/jruby/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /opt/jruby/etc/gemrc + +RUN gem install rake net-telnet xmlrpc + +# install things globally, for great justice +# and don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_BIN="$GEM_HOME/bin" \ + BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $BUNDLE_BIN:$PATH +RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ + && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" + +CMD [ "irb" ] + +FROM jruby-9.3.9.0-jre11 + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq \ + build-essential \ + shared-mime-info; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Ensure JRuby is available when running "bash --login" +RUN echo "export PATH=/opt/jruby/bin:$BUNDLE_BIN:\$PATH" >> ~/.profile + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/jruby/9.4/Dockerfile b/src/engines/jruby/9.4/Dockerfile new file mode 100644 index 0000000..b57bff5 --- /dev/null +++ b/src/engines/jruby/9.4/Dockerfile @@ -0,0 +1,108 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM eclipse-temurin:11-jammy AS jruby-9.4.7.0-jre11 + +RUN apt-get update && apt-get install -y libc6-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* + +ENV JRUBY_VERSION 9.4.7.0 +ENV JRUBY_SHA256 f1c39f8257505300a528ff83fe4721fbe61a855abb25e3d27d52d43ac97a4d80 +RUN mkdir /opt/jruby \ + && curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \ + && echo "$JRUBY_SHA256 /tmp/jruby.tar.gz" | sha256sum -c - \ + && tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \ + && rm /tmp/jruby.tar.gz \ + && update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 +ENV PATH /opt/jruby/bin:$PATH + +# skip installing gem documentation +RUN mkdir -p /opt/jruby/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /opt/jruby/etc/gemrc + +RUN gem install rake net-telnet xmlrpc + +# install things globally, for great justice +# and don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_BIN="$GEM_HOME/bin" \ + BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $BUNDLE_BIN:$PATH +RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ + && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" + +CMD [ "irb" ] + +FROM jruby-9.4.7.0-jre11 + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq \ + build-essential \ + shared-mime-info; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +# Ensure JRuby is available when running "bash --login" +RUN echo "export PATH=/opt/jruby/bin:$BUNDLE_BIN:\$PATH" >> ~/.profile + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.1/Dockerfile b/src/engines/ruby/2.1/Dockerfile new file mode 100644 index 0000000..ef89a6b --- /dev/null +++ b/src/engines/ruby/2.1/Dockerfile @@ -0,0 +1,156 @@ +# ruby:2.1.10 was based on jessie, but never got a aarch64 image +# aarch64 used to be supported upon release but is not part of LTS, so archive.debian.org does not contain aarch64: https://www.debian.org/releases/jessie/ + +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +# Here be dragons: Last time we tried to move away from Debian stretch, we ran into issues with two gems that are used in some +# of our CI tests/test apps. +# If you're going to try your luck, make sure that the following work after your changes: +# gem install mysql +# +# taken from https://github.com/docker-library/ruby/blob/c5693b25aa865489fee130e572a3f11bccebd21b/2.1/Dockerfile +FROM buildpack-deps:stretch AS ruby-2.1.10-stretch + +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + +ENV RUBY_MAJOR 2.1 +ENV RUBY_VERSION 2.1.10 +ENV RUBY_DOWNLOAD_SHA256 5be9f8d5d29d252cd7f969ab7550e31bbb001feb4a83532301c0dd3b5006e148 +ENV RUBYGEMS_VERSION 2.7.11 +ENV BUNDLER_VERSION 1.17.3 + +# Pull packages from debian archive, old repos don't work any more +RUN echo "deb [trusted=yes] http://archive.debian.org/debian/ stretch main contrib non-free" | tee /etc/apt/sources.list + +RUN set -ex \ + && apt-get update \ + # ruby 2.1 needs libssl1.0-dev + && apt-get install -y --no-install-recommends wget \ + && apt-get remove -y libssl-dev libcurl4-openssl-dev \ + && ARCH=$(dpkg --print-architecture) \ + && wget "https://snapshot.debian.org/archive/debian-security/20220317T093342Z/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u7_${ARCH}.deb" \ + && dpkg -i libssl1.0.2*.deb \ + && rm -rf libssl1.0.2*.deb \ + && wget "https://snapshot.debian.org/archive/debian-security/20220317T093342Z/pool/updates/main/o/openssl1.0/libssl1.0-dev_1.0.2u-1~deb9u7_${ARCH}.deb" \ + && dpkg -i libssl1.0-dev*.deb \ + && rm -rf libssl1.0-dev*.deb \ +# some of ruby's build scripts are written in ruby +# we purge system ruby later to make sure our final image uses what we just built + && buildDeps=' \ + bison \ + dpkg-dev \ + libgdbm-dev \ + ruby \ + ' \ + && apt-get install -y --no-install-recommends $buildDeps \ + && rm -rf /var/lib/apt/lists/* \ + && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ + && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum -c - \ + \ + && mkdir -p /usr/src/ruby \ + && tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1 \ + && rm ruby.tar.xz \ + \ + && cd /usr/src/ruby \ + \ +# hack in "ENABLE_PATH_CHECK" disabling to suppress: +# warning: Insecure world writable dir + && { \ + echo '#define ENABLE_PATH_CHECK 0'; \ + echo; \ + cat file.c; \ + } > file.c.new \ + && mv file.c.new file.c \ + \ + && autoconf \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --enable-shared \ + && make -j "$(nproc)" \ + && make install \ + \ + && apt-get purge -y --auto-remove $buildDeps \ + && cd / \ + && rm -r /usr/src/ruby \ + \ + && gem update --system "$RUBYGEMS_VERSION" \ + && gem install bundler --version "$BUNDLER_VERSION" --force \ + && rm -r /root/.gem/ + +# install things globally, for great justice +# and don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_BIN="$GEM_HOME/bin" \ + BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $BUNDLE_BIN:$PATH +RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ + && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" + +CMD [ "irb" ] + +FROM ruby-2.1.10-stretch + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install --force-yes --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq iptables; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose (1.8.0, fairly old) +RUN echo 'deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main' > /etc/apt/sources.list.d/stretch-backports.list \ + && apt-get update \ + && apt-get install -y docker-compose \ + && docker-compose version \ + && rm -rf /var/lib/apt/lists/* + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.2/Dockerfile b/src/engines/ruby/2.2/Dockerfile new file mode 100644 index 0000000..3c42d32 --- /dev/null +++ b/src/engines/ruby/2.2/Dockerfile @@ -0,0 +1,160 @@ +# ruby:2.2.10-jessie was based on jessie, and had a aarch64 image +# aarch64 used to be supported upon release but is not part of LTS, +# so archive.debian.org does not contain aarch64: https://www.debian.org/releases/jessie/ + +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +# Here be dragons: Last time we tried to move away from Debian stretch, we ran into issues with two gems that are used in some +# of our CI tests/test apps. +# If you're going to try your luck, make sure that the following work after your changes: +# gem install mysql +# +# taken from https://github.com/docker-library/ruby/blob/b5ef401d348ca9b1d9f6a5cb4b25f32bf013daca/2.2/jessie/Dockerfile +FROM buildpack-deps:stretch AS ruby-2.2.10-stretch + +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + +ENV RUBY_MAJOR 2.2 +ENV RUBY_VERSION 2.2.10 +ENV RUBY_DOWNLOAD_SHA256 bf77bcb7e6666ccae8d0882ea12b05f382f963f0a9a5285a328760c06a9ab650 +ENV RUBYGEMS_VERSION 2.7.11 +ENV BUNDLER_VERSION 1.17.3 + +# Pull packages from debian archive, old repos don't work any more +RUN echo "deb [trusted=yes] http://archive.debian.org/debian/ stretch main contrib non-free" | tee /etc/apt/sources.list + +# some of ruby's build scripts are written in ruby +# we purge system ruby later to make sure our final image uses what we just built +RUN set -ex \ + && apt-get update \ + # ruby 2.2 needs libssl1.0-dev + && apt-get install -y --no-install-recommends wget \ + && apt-get remove -y libssl-dev libcurl4-openssl-dev \ + && ARCH=$(dpkg --print-architecture) \ + && wget "https://snapshot.debian.org/archive/debian-security/20220317T093342Z/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u7_${ARCH}.deb" \ + && dpkg -i libssl1.0.2*.deb \ + && rm -rf libssl1.0.2*.deb \ + && wget "https://snapshot.debian.org/archive/debian-security/20220317T093342Z/pool/updates/main/o/openssl1.0/libssl1.0-dev_1.0.2u-1~deb9u7_${ARCH}.deb" \ + && dpkg -i libssl1.0-dev*.deb \ + && rm -rf libssl1.0-dev*.deb \ +# some of ruby's build scripts are written in ruby +# we purge system ruby later to make sure our final image uses what we just built + && buildDeps=' \ + bison \ + dpkg-dev \ + libgdbm-dev \ + ruby \ + ' \ + && apt-get install -y --no-install-recommends $buildDeps \ + && rm -rf /var/lib/apt/lists/* \ + \ + && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ + && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum -c - \ + \ + && mkdir -p /usr/src/ruby \ + && tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1 \ + && rm ruby.tar.xz \ + \ + && cd /usr/src/ruby \ + \ +# hack in "ENABLE_PATH_CHECK" disabling to suppress: +# warning: Insecure world writable dir + && { \ + echo '#define ENABLE_PATH_CHECK 0'; \ + echo; \ + cat file.c; \ + } > file.c.new \ + && mv file.c.new file.c \ + \ + && autoconf \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --enable-shared \ + && make -j "$(nproc)" \ + && make install \ + \ + && apt-get purge -y --auto-remove $buildDeps \ + && cd / \ + && rm -r /usr/src/ruby \ + \ + && gem update --system "$RUBYGEMS_VERSION" \ + && gem install bundler --version "$BUNDLER_VERSION" --force \ + && rm -r /root/.gem/ + +# install things globally, for great justice +# and don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_BIN="$GEM_HOME/bin" \ + BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $BUNDLE_BIN:$PATH +RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ + && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" + +CMD [ "irb" ] + +FROM ruby-2.2.10-stretch + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install --force-yes --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq iptables; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose (1.8.0, fairly old) +RUN echo 'deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main' > /etc/apt/sources.list.d/stretch-backports.list \ + && apt-get update \ + && apt-get install -y docker-compose \ + && docker-compose version \ + && rm -rf /var/lib/apt/lists/* + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.3/Dockerfile b/src/engines/ruby/2.3/Dockerfile new file mode 100644 index 0000000..1d33594 --- /dev/null +++ b/src/engines/ruby/2.3/Dockerfile @@ -0,0 +1,83 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image +# +# Here be dragons: Last time we tried to move away from Debian stretch, we ran into issues with two gems that are used in some +# of our CI tests/test apps. +# If you're going to try your luck, make sure that the following work after your changes: +# gem install nokogiri -v '= 1.10.10' +# gem install mysql +# +# Last version: https://github.com/docker-library/ruby/blob/31f66490fdb837ddcc5896e3275f2188f2b7b6dd/2.3/stretch/Dockerfile +FROM ruby:2.3.8-stretch + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Pull packages from debian archive, old repos don't work any more +RUN echo "deb [trusted=yes] http://archive.debian.org/debian/ stretch main contrib non-free" | tee /etc/apt/sources.list + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install --force-yes --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq iptables; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose (1.8.0, fairly old) +RUN echo 'deb [trusted=yes] http://archive.debian.org/debian/ stretch-backports main' > /etc/apt/sources.list.d/stretch-backports.list \ + && apt-get update \ + && apt-get install -y docker-compose \ + && docker-compose version \ + && rm -rf /var/lib/apt/lists/* + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Install RubyGems and Bundler +# NOTE: Rubygems 3.0.6 is the last version that seems to work fine in this image AND not drag bundler 2 along. +# Later versions are either broken or they force the use of bundler 2, which we can't use because some of our +# dependencies (e.g. rails 3.0.20) don't like it. +RUN gem update --system '3.0.6' +# Ruby 2.3 can support Bundler 2+ +# But hold back to < 2 for now, because some dependencies require it. +RUN gem install bundler -v '1.17.3' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.4/Dockerfile b/src/engines/ruby/2.4/Dockerfile new file mode 100644 index 0000000..68361da --- /dev/null +++ b/src/engines/ruby/2.4/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:2.4.10-buster + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Install RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.5/Dockerfile b/src/engines/ruby/2.5/Dockerfile new file mode 100644 index 0000000..5f20c24 --- /dev/null +++ b/src/engines/ruby/2.5/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:2.5.9-buster + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Install RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.6/Dockerfile b/src/engines/ruby/2.6/Dockerfile new file mode 100644 index 0000000..b269e31 --- /dev/null +++ b/src/engines/ruby/2.6/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:2.6.10-bullseye + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Install RubyGems +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/2.7/Dockerfile b/src/engines/ruby/2.7/Dockerfile new file mode 100644 index 0000000..a0da1b2 --- /dev/null +++ b/src/engines/ruby/2.7/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:2.7.8-bullseye + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler # Upgrading disabled until https://github.com/thoughtbot/appraisal/issues/162 is fixed +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/3.0/Dockerfile b/src/engines/ruby/3.0/Dockerfile new file mode 100644 index 0000000..46b4f18 --- /dev/null +++ b/src/engines/ruby/3.0/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:3.0.7-bullseye + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/3.1/Dockerfile b/src/engines/ruby/3.1/Dockerfile new file mode 100644 index 0000000..03e7aaf --- /dev/null +++ b/src/engines/ruby/3.1/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:3.1.6-bookworm + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat-openbsd unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/3.2/Dockerfile b/src/engines/ruby/3.2/Dockerfile new file mode 100644 index 0000000..421cb40 --- /dev/null +++ b/src/engines/ruby/3.2/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:3.2.4-bookworm + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat-openbsd unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/3.3/Dockerfile b/src/engines/ruby/3.3/Dockerfile new file mode 100644 index 0000000..042dd7c --- /dev/null +++ b/src/engines/ruby/3.3/Dockerfile @@ -0,0 +1,68 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:3.3.2-bookworm + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat-openbsd unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Upgrade RubyGems and Bundler +RUN gem update --system 3.3.26 +RUN gem install bundler -v '~> 2.3.26' +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/src/engines/ruby/3.4/Dockerfile b/src/engines/ruby/3.4/Dockerfile new file mode 100644 index 0000000..f27c7b3 --- /dev/null +++ b/src/engines/ruby/3.4/Dockerfile @@ -0,0 +1,65 @@ +# Note: See the "Publishing updates to images" note in ./README.md for how to publish new builds of this container image + +FROM ruby:3.4.0-preview1-bookworm + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat-openbsd unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim less jq; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/$(arch)/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/$(arch)/${DOCKER_VERSION}" \ + && echo DOCKER_URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls51/docker-compose-$(dpkg --print-architecture)" \ + && echo COMPOSE_URL: $COMPOSE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://github.com/powerman/dockerize/releases/download/v0.17.0/dockerize-$(uname -s | tr '[:upper:]' '[:lower:]')-$(arch | sed 's/aarch64/arm64/')" \ + && echo DOCKERIZE_URL: $DOCKERIZE_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL \ + && chmod +x /usr/local/bin/dockerize \ + && dockerize --version + +# Install RubyGems +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"]