Home > Software engineering >  Error when building image from Dockerfile
Error when building image from Dockerfile

Time:12-24

-Error when building and image from Dockerfile:

FROM ubuntu:16.04
MAINTAINER Name Surname "[email protected]"
ENV REFRESHED_AT 2021-12-24
RUN apt-get update -yqq; apt-get -yqq install ruby ruby-dev build-essential redis-tools
RUN gem install --no-rdoc --no-ri sinatra json redis
RUN mkdir -p /opt/webapp
EXPOSE 4567
CMD [ "/opt/webapp/bin/webapp" ]

-The error log:

Step 5/8 : RUN gem install --no-rdoc --no-ri sinatra json redis
 ---> Running in 061004febbcd
Successfully installed rack-2.2.3
Successfully installed tilt-2.0.10
Successfully installed rack-protection-2.1.0
Successfully installed ruby2_keywords-0.0.5
Successfully installed mustermann-1.1.1
Successfully installed sinatra-2.1.0
Building native extensions.  This could take a while...

ERROR:  Error installing redis:
    redis requires Ruby version >= 2.4.0.

Successfully installed json-2.6.1
7 gems installed
The command '/bin/sh -c gem install --no-rdoc --no-ri sinatra json redis' returned a non-zero code: 1

How can i install specific version of Ruby?

CodePudding user response:

do you need to use the ubuntu 16.04?

if you use a newer version of ubuntu, like 20.04 it should install a newer version of Ruby.

  • Related