Skip to content

Commit

Permalink
[dist] Adapt binary names to ruby2.5
Browse files Browse the repository at this point in the history
Since we are not using the ruby version defined by the base system, but
the one OBS uses, we have to adjust the call of the binaries that were
installed via gem command.
  • Loading branch information
bgeuken authored and ChrisBr committed Feb 8, 2018
1 parent b1c469b commit caac1fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ RUN chown -R frontend /obs/src/api
USER frontend
WORKDIR /obs/src/api

# foreman, which we only run in docker, needs a different thor version than OBS.
# Installing the gem directly spares us from having to rpm package two different thor versions.
RUN sudo gem.ruby2.5 install thor:0.19 foreman
# Ensure there is a foreman command without ruby suffix
RUN sudo ln -s /usr/bin/foreman.ruby2.5 /usr/bin/foreman

# FIXME: Retrying bundler if it fails is a workaround for https://github.com/moby/moby/issues/783
# which seems to happen on openSUSE (< Tumbleweed 20171001)...
RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 || bundle install --jobs=3 --retry=3

# Run our command
CMD ["foreman", "start", "-f", "Procfile"]
CMD ["foreman", "start", "-f", "Procfile"]
2 changes: 1 addition & 1 deletion Dockerfile.frontend-base
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN chown -R frontend /obs/src/api
USER frontend
WORKDIR /obs/src/api

# Set up some convenience ruby binaries...
# Ensure there are ruby, gem and irb commands without ruby suffix
RUN for i in ruby gem irb; do ln -s /usr/bin/$i.ruby2.5 ~/bin/$i; done

# Install our bundle
Expand Down

0 comments on commit caac1fa

Please sign in to comment.