Files
osem/Dockerfile
Henne Vogelsang 6f3111c35d Fix docker shell environment
Move shared variables (nokogiri/path etc.) into the base image.

Fixes #2917
2022-03-01 15:43:23 +01:00

27 lines
799 B
Docker

FROM registry.opensuse.org/opensuse/infrastructure/dale/containers/osem/base:latest
ARG CONTAINER_USERID
# Configure our user
RUN usermod -u $CONTAINER_USERID osem
# We copy the Gemfiles into this intermediate build stage so it's checksum
# changes and all the subsequent stages (a.k.a. the bundle install call below)
# have to be rebuild. Otherwise, after the first build of this image,
# docker would use it's cache for this and the following stages.
COPY Gemfile /osem/
COPY Gemfile.lock /osem/
RUN chown -R osem /osem
# Install bundler & foreman
RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" /osem/Gemfile.lock | tail -n 1)"; \
gem install foreman
# Continue as user
USER osem
WORKDIR /osem/
# Install our bundle
RUN bundle install --jobs=3 --retry=3
CMD ["foreman", "start"]