Ruby Docker images based on Alpine Linux Edit
692
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.

Dockerfile in your Ruby app projectFROM 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
Gemfile.lockThe 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
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
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.
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.
Content type
Image
Digest
Size
49.9 MB
Last updated
over 8 years ago
docker pull bandsintown/ruby:2.4.2-5bdebfa