Closed tf closed 3 years ago
how are you explicitly setting the default version, @tf?
I have the following line in my Dockerfile:
RUN /pd_build/ruby-2.5.*.sh && bash -lc 'rvm --default use 2.5'
RUN bash -lc 'rvm --default use ruby-2.6.3'
seems to have done the trick for me (after installing that version of ruby).
Might be fixed on master
since https://github.com/phusion/passenger-docker/commit/5cba6c7becd5979fadde50878892513ae8293646#diff-8fdcb365e86ae9f412339d9d2f8202a58b522430916ee6956503f9c17a6be7dd changed the logic to not expect the newest Ruby to be the first Ruby in rvm list strings
at least when detecting installed Ruby versions
https://github.com/phusion/passenger-docker/commit/e6a022b3454863c53dabd20b28ba902a0e8a4eea#diff-8fdcb365e86ae9f412339d9d2f8202a58b522430916ee6956503f9c17a6be7dd now also made this change for actually selecting the default version.
should be fixed now
Building a Docker image based on
phusion/passenger-customizable
, I see different Ruby versions picked as default depending on the build environment:The resulting image contains Ruby 2.6 and Ruby 2.5 (which is not in line with what the readme says: #298) . Building the image locally results in Ruby 2.6 being selected as default RVM Ruby version. Building the image in CI, Ruby 2.5 is selected. As part of the
RUN
step, I see different outputs:Digging deeper, I see that the order of Ruby versions reported by
rvm list strings
appears to depend on the environment. If I extend my DockerfileI see that in CI the order of the output is different:
ruby_support/finalize.sh
appears to depend on this order:https://github.com/phusion/passenger-docker/blob/8f6bb02e93b4b39f0f3a43381e88c3f241a52186/image/ruby_support/finalize.sh#L20-L31
It sets the first listed Ruby as default. As a workaround, I can explicitly specify the desired default version in my Dockerfile. The current default behavior appears to be fragile, though.