Skip to content

Commit

Permalink
[dist] Create the links to executables system wide
Browse files Browse the repository at this point in the history
Create the links to the executable file in /usr/local/bin/ , where they
can be reached.

Previously, even they were created in ~/bin/ they were not used because
the $PATH variable was not correctly set for the user "frontend".
  • Loading branch information
eduardoj committed Feb 8, 2018
1 parent 5de5680 commit 5792ae0
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 5792ae0

Please sign in to comment.