How can I install ruby 2.7.2 (Dockerfile) in Ubuntu 18.04?

Viewed 2888

I am creating a Dockerfile and somehow I can't install the ruby version I need: 2.7.2 . Since I just need this version, I don't want to install ruby through rbenv or rvm. I tried "apt install ruby", "apt get install ruby 2.7.2", "apt install ruby-full" and the version installed is always 2.5.1. Any Ideas?

This is how my Dockerfile looks like:

FROM nvidia/cuda:10.1-base-ubuntu18.04

LABEL version="0.0.1"

LABEL maintainer="mjg"

RUN apt update \
    && apt install -y python3.6 python3-pip \
    && apt install -y ruby

WORKDIR /cvlib

RUN pip3 install --upgrade pip; \
    pip3 install opencv-python tensorflow cvlib; \
    apt install -y libsm6 libxext6 libxrender-dev libgl1-mesa-glx; \
    apt remove -y python3-pip

WORKDIR /app

COPY . .

VOLUME [ "/app/blurred-images", "app/source-images" ]
1 Answers

Using apt install ruby will install ruby version from distribution repository, which in your case in ruby 2.5.1. You should consider installing it with ruby version managers like rbenv or rvm, because they allow you to specify specific version that you want to install.

Related