Sign inSign up

lulzon/ruby:0.0.2

Manifest digest

sha256:7824757a66ac1818a7395e504866ff885523a17c84143b2463b5f29e40f91378

Last pushed

1 day by lulzon

Type

Sandbox Kit

Manifest digest

sha256:7824757a66ac1818a7395e504866ff885523a17c84143b2463b5f29e40f91378

yaml
schemaVersion: "3"
displayName: Ruby
author: Nick Lozon <[email protected]>
description: Install ruby as a mixin
sourceUrl: https://github.com/nicklozon/sbx-ruby-mixin
kind: mixin
capabilities:
    - type: com.docker.sandbox/lifecycle@1
      config:
        install:
            - command: |
                set -eu
                RUBY_VERSION='${{ kit.args.version }}'

                case "$(uname -m)" in
                  x86_64) asset_arch=x64 ;;
                  aarch64|arm64) asset_arch=arm64 ;;
                  *) echo "ruby/ruby-builder publishes no ${TARGETARCH} binaries" >&2; exit 1 ;;
                esac

                # ubuntu-22.04 is the oldest glibc (2.35) ruby-builder publishes for, so the
                # binaries run on the widest range of workload images.
                tag="ruby-${RUBY_VERSION}"
                asset="${tag}-ubuntu-22.04-${asset_arch}.tar.gz"
                url="https://github.com/ruby/ruby-builder/releases/download/${tag}/${asset}"
                curl -fsSL -o /tmp/runtime.tar.gz "${url}"
                tar xzf /tmp/runtime.tar.gz --strip-components=1 -C /usr/local
                ldconfig
              user: "0"
    - type: com.docker.sandbox/network-policy@1
      config:
        runtime:
            allow:
                - rubygems.org:443
                - index.rubygems.org:443
args:
    version:
        default: 3.4.0
        description: Release to install, as published by ruby/ruby-builder.
        pattern: ^[0-9]+\.[0-9]+\.[0-9]+$