Open yeoleobun opened 2 years ago
it works!!!
FROM ubuntu:18.04
RUN apt-get -qq update && apt-get -qq install ruby ruby-dev build-essential redis-tools
RUN gem install --no-rdoc --no-ri json redis
RUN gem install --no-rdoc --no-ri sinatra -v 2.2.2
RUN mkdir -p /opt/webapp
EXPOSE 4567
CMD [ "sh", "-c", "ruby /opt/webapp/bin/webapp" ]
The code at https://github.com/turnbullpress/dockerbook-code/blob/master/code/5/sinatra/webapp/Dockerfile#L6 and https://github.com/turnbullpress/dockerbook-code/blob/master/code/5/sinatra/webapp_redis/Dockerfile#L6 can't progress.
According https://github.com/sinatra/sinatra/blob/master/README.md?plain=1#L2828
But the version of ruby on apt is 2.5.0, and sinatra version on gem is 3.0.2, so it's a conflict.
It's better to give a specific version to sinatra. (2.2.2 was latest supporting Ruby 2.5)