Sign inSign up

bandsintown/ruby

By bandsintown

Updated over 8 years ago

Ruby Docker images based on Alpine Linux Edit

Image
1

692

bandsintown/ruby repository overview

dockeri.co

Build status GitHub issues GitHub stars Docker layers

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.

logo

How to use this image

Create a Dockerfile in your Ruby app project

FROM bandsintown/ruby:2.4.2
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 bandsintown/ruby:2.4.2 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 bandsintown/ruby:2.4.2 ruby your-daemon-or-script.rb

Motivation

This image is based on the Official Docker image but we are using our base Alpine image.

We built this image to use Consul and Consul Template to be able to configure ruby applications dynamically.

License

All the code contained in this repository, unless explicitly stated, is licensed under ISC license.

A copy of the license can be found inside the LICENSE file.

Tag summary

Content type

Image

Digest

Size

49.9 MB

Last updated

over 8 years ago

docker pull bandsintown/ruby:2.4.2-5bdebfa