Public Repository

Last pushed: 7 months ago
Short Description
Ruby is a dynamic, reflective, object-oriented, general-purpose, open-source programming language.
Full Description

DEPRECATED

The armel organization is deprecated in favor of the more-specific arm32v5 organization, as per https://github.com/docker-library/official-images#architectures-other-than-amd64. Please adjust your usages accordingly.

Supported tags and respective Dockerfile links

THESE IMAGES ARE VERY EXPERIMENTAL; THEY ARE PROVIDED ON A BEST-EFFORT BASIS WHILE docker-library/official-images#2289 IS STILL IN-PROGRESS (which is the first step towards proper multiarch images)

PLEASE DO NOT USE THEM FOR IMPORTANT THINGS

This image is built from the source of the official image of the same name (ruby). Please see that image's description for links to the relevant Dockerfiles.

If you are curious about specifically how this image differs, see the Jenkins Groovy DSL scripts in the tianon/jenkins-groovy GitHub repository, which are responsible for creating the Jenkins jobs which build them.

Quick reference

What is Ruby?

Ruby is a dynamic, reflective, object-oriented, general-purpose, open-source programming language. According to its authors, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.

wikipedia.org/wiki/Ruby_(programming_language)

How to use this image

Create a Dockerfile in your Ruby app project

FROM ruby:2.1-onbuild
CMD ["./your-daemon-or-script.rb"]

Put this file in the root of your app, next to the Gemfile.

This image includes multiple ONBUILD triggers which should be all you need to bootstrap most applications. The build will COPY . /usr/src/app and RUN bundle install.

You can then build and run the Ruby image:

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

Generate a Gemfile.lock

The onbuild tag expects a Gemfile.lock in your app directory. This docker run will help you generate one. Run it in the root of your app, next to the Gemfile:

$ docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.1 bundle install

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":/usr/src/myapp -w /usr/src/myapp ruby:2.1 ruby your-daemon-or-script.rb

Encoding

By default, Ruby inherits the locale of the environment in which it is run. For most users running Ruby on their desktop systems, that means it's likely using some variation of *.UTF-8 (en_US.UTF-8, etc). In Docker however, the default locale is C, which can have unexpected results. If your application needs to interact with UTF-8, it is recommended that you explicitly adjust the locale of your image/container via -e LANG=C.UTF-8 or ENV LANG C.UTF-8.

License

View license information for the software contained in this image.

Docker Pull Command
Owner
armel