Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Ruby on docker?

I am trying to install ruby on docker. I could install the 1.9 versions but it is not possible to install the latest version such as 2.2.0 and above. I am actually trying to set up calabash on docker. Have tried this. Whenever I try to install calabash-android in it getting the error

ERROR:  Error installing calabash-android:
luffa requires Ruby version >= 2.0.
like image 207
Muneer Muhammed Avatar asked Mar 30 '16 10:03

Muneer Muhammed


People also ask

How do I run a Rails program in docker?

Rebuild the applicationlock to the host, followed by docker compose up --build . Now, rebuild and restart the app with docker compose up --build . Inside the container, your app is running on the same port as before 3000 , but the Rails Welcome is now available on http://localhost:3001 on your local host.

What is Ruby docker image?

Ruby is a dynamic, reflective, object-oriented, general-purpose, open-source programming language. OverviewTags.

Does Alpine have Ruby?

The smallest Docker image with Ruby, is based on Alpine Linux image, which is only a 5MB image. It does only have ruby and bundler (except image with tiny tag).


1 Answers

You could start view a dockerfile starting with:

# 2016
FROM ruby:2.3.0

# 2020
# Import your ruby version
FROM ruby:2.7.1
# Install bundler gem
RUN gem install bundler
# Assign a work directory
WORKDIR /work

That would use the docker image ruby, with ruby already installed.

The 2020 version comes from "Ruby version management with docker" from Arjun Das, mentioned by ArMD in the comments.

like image 98
VonC Avatar answered Sep 20 '22 07:09

VonC