Skip to content

DashBrains/ubi-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby UBI

[dockeri.co

GitHub issues GitHub stars

The Ruby image based on Redhat UBI.

Table of Contents

What is Ruby?

A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

See: https://www.ruby-lang.org

How to use this image

Create a Dockerfile in your Ruby app project

# specify the ruby base image with your desired version ruby:<version>-<ubi-version>
FROM ruby:3.2.2-ubi9
# replace this with your application's default port
EXPOSE 8888

You can then build and run the Docker image:

$ docker build -t my-ruby-app .
$ docker run -it --rm --name my-running-app my-ruby-app

If you prefer Docker Compose:

version: "2"
services:
  ruby:
    image: "ruby-ubi:3.2.2-ubi9"
    working_dir: /app
    expose:
      - "8081"
    command: "ruby app.rb"

You can then run using Docker Compose:

$ docker-compose up -d

Run a single Ruby script

For many simple, single file projects, you may find it inconvenient to write a complete Dockerfile. In such cases, you can run a Ruby script by using the Ruby Docker image directly:

$ docker run -it --rm --name my-running-script -v "$PWD":/app -w /app ruby-uby:3.2.2-ubi9 ruby your-daemon-or-script.rb

Image Variants

The ruby-ubi images come in many flavors, each designed for a specific use case. All of the images contain pre-installed versions of ruby, bundle. For each supported architecture, the supported variants are different.

ruby-ubi::<version>-ubi9

This image is based on version 9 of UBI, available in the ubi9 official image.

ruby-ubi::<version>-ubi8

This image is based on version 8 of UBI, available in the ubi8 official image.

License

License information for the Ruby UBI Docker project.

Supported Docker versions

This image is officially supported on Docker version 1.9.1.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

Supported Ruby versions

This project will support Ruby versions as still under active support as per the Ruby Maintenance Branches.