Skip to content

Commit

Permalink
[dist] Fix image builds in docker hub
Browse files Browse the repository at this point in the history
It seems that docker hub assumes that the directory containing the
docker file is the build context.
If that's correct, this should fix our image build in docker hub.
  • Loading branch information
bgeuken committed Feb 13, 2018
1 parent e95fe70 commit 7f3b667
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
29 changes: 29 additions & 0 deletions src/api/Dockerfile.frontend-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM openbuildservice/base

RUN /root/bin/docker-bootstrap.sh frontend

# Install other requirements
RUN npm install -g jshint

ADD Gemfile /obs/src/api/Gemfile
ADD 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

# 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)...
RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 || bundle install --jobs=3 --retry=3

# Switch to root again so we don't block changing our frontend user id...
USER root

# Run our command
CMD ["/bin/bash", "-l"]
29 changes: 0 additions & 29 deletions src/api/docker-files/Dockerfile.frontend-base

This file was deleted.

1 change: 1 addition & 0 deletions src/api/docker-files/Dockerfile.frontend-base

0 comments on commit 7f3b667

Please sign in to comment.