Skip to content

Commit

Permalink
Merge pull request #4468 from eduardoj/docker/move_links_to_usr_local…
Browse files Browse the repository at this point in the history
…_bin

[dist] Create the links to executables system wide
  • Loading branch information
bgeuken committed Feb 12, 2018
2 parents b89a6fb + 5792ae0 commit 62383e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ ADD src/api/Gemfile /obs/src/api/Gemfile
ADD src/api/Gemfile.lock /obs/src/api/Gemfile.lock
RUN chown -R frontend /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 gem.ruby2.5 install thor:0.19 foreman
# Ensure there is a foreman command without ruby suffix
RUN ln -s /usr/bin/foreman.ruby2.5 /usr/local/bin/foreman

# Now do the rest as the user with the same ID as the user who
# builds this container
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)...
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.frontend-base
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ ADD src/api/Gemfile /obs/src/api/Gemfile
ADD src/api/Gemfile.lock /obs/src/api/Gemfile.lock
RUN chown -R frontend /obs/src/api

# 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 /usr/local/bin/$i; done

# Now do the rest as the user with the same ID as the user who
# builds this container
USER frontend
WORKDIR /obs/src/api

# 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
# 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)...
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.old-test-suite
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ ADD src/api/Gemfile.lock /obs/src/api/Gemfile.lock
ADD contrib/start_old_tests /obs/contrib/start_old_tests
RUN chown -R frontend:users /obs/

# Set up some convenience ruby binaries...
RUN for i in ruby gem irb; do ln -s /usr/bin/$i.ruby2.5 /usr/local/bin/$i; done

USER frontend
WORKDIR /obs/src/api

# Set up some convenience ruby binaries...
RUN for i in ruby gem irb; do ln -s /usr/bin/$i.ruby2.5 ~/bin/$i; done

# Install our bundle
# 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)...
Expand Down

0 comments on commit 62383e1

Please sign in to comment.